Device: Add media and noise-control stem gesture actions#526
Merged
Conversation
Adds Stop, Fast Forward, Rewind, Mute, Cycle Noise Control, and Toggle Transparency as gesture targets. Migrates StemAction from enum to sealed interface with polymorphic serialization to unlock future parameterized actions. ANC actions are gated per-device capability and reuse the existing listening-mode cycle mask.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Technical Context
StemActionmigrates from a flatenumto asealed interfacewith@Serializable @SerialName(…)data objects, so future parameterized actions can be added without another call-site sweep.StemPressReactionintentionally does NOT injectDeviceMonitor— that would create a Hilt cycle viaAapLifecycleManager. Instead it reads live AAP state fromAapConnectionManager.allStateswith a profile-learned-values fallback (same patternStemConfigSenderalready uses).resolvedAncCycleMask+allowOffOption?.enabled+pendingAncMode, so rapid repeat presses advance from the pending target rather than stale state, and the gesture cycle matches what the Noise Control dialog says.ToggleAncTransparencyis stateless: leaving Transparency prefers ON, falls back to ADAPTIVE, then OFF.MuteToggletargetsSTREAM_MUSICexplicitly (not the currently-suggested stream) — intent is "mute my music", not "mute whatever Android routes next".device?.model ?: profile?.modeland is split per action:CycleAncrequireshasListeningModeCycle,ToggleAncTransparencyrequireshasAncControl. An already-configured action always stays visible inside its own dropdown row.Review checklist
Cycle Noise Controladvances through the cycle configured in the Noise Control dialog, and respects "Allow Off"hasListeningModeCycle:Cycle Noise Controlis hidden from the dropdown;Toggle Transparencystill appears if the model has ANCCycle Noise Control; reappears for other long-press mappingsMute Musicmutes music playback specifically (not ringer / call audio)