cloudfox-coreshift-core 2.33.0

Low-level Linux and Android systems primitives for CoreShift (CloudFox)
Documentation
//! On-device smoke test for the audio-active gate.
//!
//! One binder transaction to the `audio` service, decoded by the library
//! (`audio_has_active_playback`): prints whether any player is in
//! `PLAYER_STATE_STARTED`.
//!
//!     cargo build --target aarch64-linux-android --example audio_probe
//!     adb push target/aarch64-linux-android/debug/examples/audio_probe /data/local/tmp/
//!     adb shell /data/local/tmp/audio_probe

// The `audio_has_active_playback` API is android-only (binder probe); the
// host build keeps a stub `main` so `cargo test` compiles the example.
#[cfg(target_os = "android")]
fn main() {
    match coreshift_core::binder::audio_has_active_playback() {
        Ok(true) => println!("audio_active=1 (playerState==STARTED)"),
        Ok(false) => println!("audio_active=0 (no STARTED player)"),
        Err(e) => println!("audio_active=ERR {e}"),
    }
}

#[cfg(not(target_os = "android"))]
fn main() {
    eprintln!("audio_probe: android-only (binder probe)");
}