feat(audio): add ModeStack pure refcount helper (SDD-108)

Introduce ModeStack, a pure-Rust refcount-composable wrapper for
Android audio-mode acquire/release with prior-mode snapshot. Per
SDD-108 §1/§2 the engine snapshots the system audio mode on first
acquire and restores it on last release; composed acquires are
no-ops while the mode is held.

ModeStack is panic-free; release-on-zero returns AlreadyReleased
rather than panicking. Six SWE4-UV-045-tagged unit tests cover the
acquire/release semantics on the host target.

Trace: SDD-108, SWE4-UV-045.
This commit is contained in:
EdisonJwa
2026-05-18 10:30:25 +08:00
parent dc9c5c0a4e
commit da0b208075
2 changed files with 244 additions and 0 deletions
+1
View File
@@ -29,6 +29,7 @@
#![warn(missing_docs)]
mod engine;
pub mod mode_stack;
pub mod ptt;
pub mod ptt_backends;
pub mod release_tail;