/*
 * Hermes Node Android
 * Copyright (C) 2026 Stefy Lanza <stefy@nexlab.net>
 * SPDX-License-Identifier: GPL-3.0-or-later
 */
package net.nexlab.hermesnodeandroid

import android.content.Intent

/**
 * Process-local holder for Android consent grants that cannot be stored durably.
 * MediaProjection grants are intentionally volatile and must be provided by user consent.
 */
object AndroidRuntimeGrants {
    @Volatile var mediaProjectionResultCode: Int? = null
    @Volatile var mediaProjectionData: Intent? = null

    fun setMediaProjection(resultCode: Int, data: Intent?) {
        mediaProjectionResultCode = resultCode
        mediaProjectionData = data
    }

    fun hasMediaProjection(): Boolean = mediaProjectionResultCode != null && mediaProjectionData != null
}
