Repository navigation
Conversation
What was wrong: AACPManager.kt:1251 looked up the previous type in the local 'devices' list, which is empty for each unique MAC, so existingDevice was always null and the type set by SMART_ROUTING_RESP (iPad, Mac, Linux...) was dropped on every CONNECTED_DEVICES update (line 519 replaces connectedDevices).
Fix: look up the previous list, connectedDevices.find { it.mac == mac }. connectedDevices still holds the old list while parsing because line 519 assigns the result only after parseConnectedDevicesResponse returns.
How checked: code reading only (origin/main 89356c0). Not built, no Android SDK available.
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
AACPManager.kt:1251looked up the previous device type in the localdeviceslist, which is empty.existingDevicewas always null, so the type set by SMART_ROUTING_RESP (iPad, Mac, Linux...) was dropped on every CONNECTED_DEVICES update, which replacesconnectedDevices.Fix
Look it up in
connectedDevices.find { it.mac == mac }. That still holds the old list while parsing, because the new list is assigned only afterparseConnectedDevicesResponsereturns.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