package com.foxx.androidcast;

/*********************************************************************
 * CastActiveState.java
 * Created at: Sat 16 May 2026 13:35:48 +0200
 * Updated at: Wed 20 May 2026 15:17:13 +0200 by Anton Afanasyeu <a.afanasieff@gmail.com>
 * Commit: 5d8e82d2e60a21fff3138d2a394ee4e8b4c6dcb8
 * class CastActiveState
 * Contributors:
 *    - Anton Afanasyeu <a.afanasieff@gmail.com> (3 commits, 34 lines)
 *    - Cursor Agent (project assistant)
 * Digest: SHA256	eeb5dc6633d096a40bdb9e6b70e4085e0b4f475882dff24b2b8d05331fe67f68
**********************************************************************/
import java.util.concurrent.atomic.AtomicBoolean;

/** Process-wide cast session flags for UI back-key handling. */
public final class CastActiveState {
    private static final AtomicBoolean senderCasting = new AtomicBoolean(false);
    private static final AtomicBoolean receiverListening = new AtomicBoolean(false);

    private CastActiveState() {}

    public static void setSenderCasting(boolean active) {
        senderCasting.set(active);
    }

    public static boolean isSenderCasting() {
        return senderCasting.get();
    }

    public static void setReceiverListening(boolean active) {
        receiverListening.set(active);
    }

    public static boolean isReceiverListening() {
        return receiverListening.get();
    }
}
