General: Add Quick Settings tile for noise control#574
Merged
Conversation
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
Adds a Quick Settings tile that cycles AirPods noise control modes (Off / Transparency / Adaptive / Noise Cancellation) right from the system swipe-down panel — no need to open the app.
The tile auto-targets the user's primary device (system-connected first, then most recently seen). Each tap advances to the next available mode; rapid taps coalesce into a single command 1 s after the last tap, so the AirPods don't choke on a burst.
Pro-required, Bluetooth-off, no-device, and connecting states are surfaced honestly — the tile never claims to be ready when it isn't.
Technical Context
@Singleton AncTileStateStore) instead of per-TileService-instance: services are destroyed between panel sessions, so per-instance state forced the first tap of each session to await a hot flow emission — that produced a perceptible 500 ms hang on every panel reopen.@Singletonwith per-address debouncedJobs. Without process-scoped coalescing, taps across consecutive panel sessions each fired their ownSetAncMode, overwhelming AAP verification and triggering "Rejected after retry" cascades that left the device unresponsive until app restart.DeviceMonitor, a multi-hundred-ms round trip. Without an overlay, the icon doesn't move until the echo arrives and cycling feels laggy. Pipeline is split —applyPendingTargetis pure (read-only overlay),acknowledgeDeviceStateis the side-effecting clear, called from a dedicated collector.pendingAncMode(e.g. socket dropped before the debounced send fires) — otherwise a failed send would freeze the optimistic overlay.device.visibleAncModesso the tile honours "Allow Off" + Listening Mode Cycle the same way the home-screen widget does, no separate filtering logic.PodDeviceTierextracted so tile and overview agree on "primary device" via a single comparator.Closes #573