Fix: Hide settings consistently when AirPods can't be controlled#580
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
When CAPod could see your AirPods over Bluetooth but couldn't take full control of them (for example because another app or your Mac was holding the AirPods connection), the device settings screen mixed two different "unavailable" states: most settings disappeared, but the Microphone selector and the Press controls entry stayed on screen as greyed-out items. That made it look as if those two settings had a separate problem from the rest.
They now hide together with the other settings whenever the AirPods aren't responding to commands, so the screen reads consistently: a setting is shown when it can be used, and hidden when it can't.
Technical Context
Sound > MicrophoneandControls > Press controlswas gated only on the staticModel.Featuresflag, while every other AAP-dependent row in the same screen usedfeatures.hasX && device.X != null. When AAP is inaap != null && connectionState != READY(e.g. socket connects then stalls inHANDSHAKING), the live setting values are null butModel.Featuresflags are static, so the two outliers kept rendering and gotenabled = device.isAapReady(false).showSoundSection/showControlsSectiongates plus the innerSoundCard/ControlsCardrows). No new pattern introduced — just brings the outliers in line with ANC, Tone Volume, Volume Swipe, etc.PressControlsScreenalready auto-navigates back when AAP drops mid-session (PressControlsScreen.kt:74-84), so hiding the entry point on the parent screen makes the destination's behaviour consistent in both directions.