Repository navigation
Conversation
What was wrong: AccessibilitySettingsScreen.kt:282-293 seeds toneVolumeValue with remember {} (no key), and the snapshotFlow in LaunchedEffect emits its initial value on collection. After the 100 ms debounce that value was written to the AirPods (CHIME_VOLUME) on every visit to the screen, using stale state or the 75f fallback if controlStates was not loaded yet.
Fix: add .drop(1) before .debounce so the initial emission is skipped; only real slider changes are sent. Adds the kotlinx.coroutines.flow.drop import next to debounce.
How checked: code reading only, not built (no Android SDK here). Re-read the diff for syntax and types: drop(1) is a Flow<Float> extension in kotlinx.coroutines.flow, the import is alphabetically placed, and no other drop identifier exists in the file.
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 was wrong
AccessibilitySettingsScreen.kt:282-293: thesnapshotFlowontoneVolumeValueemits its initial value on collection, so after the 100 ms debounce the screen wrote CHIME_VOLUME to the AirPods on every visit, using stale state or the 75 fallback if control states were not loaded yet.Fix
.drop(1)before.debounce, so only real slider changes are sent.Verified
./gradlew :app:compileFossDebugKotlinand:app:compilePlayDebugKotlinboth pass on this branch (BUILD SUCCESSFUL, no new warnings). The change was also checked by reading the code.Not verified
Not run on a device or with AirPods; no unit test (the project has no Android test setup for this class).
🤖 Generated with Claude Code