// Copyright (C) 2023 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License") override;
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#include <memory>
#include <optional>

#include "aemu/base/Compiler.h"

namespace gfxstream {
namespace magma {

class Connection;

class DrmContext {
   public:
    ~DrmContext();
    DISALLOW_COPY_AND_ASSIGN(DrmContext);
    DrmContext(DrmContext&&) noexcept;
    DrmContext& operator=(DrmContext&&) = delete;

    static std::unique_ptr<DrmContext> create(Connection& connection);
    uint32_t getId();

   private:
    DrmContext(Connection& device);

    Connection& mConnection;
    std::optional<uint32_t> mId;
};

}  // namespace magma
}  // namespace gfxstream
