Fix Android LE Audio device type decoding - #187
Open
akshatgoel07 wants to merge 2 commits into
Open
Conversation
akshatgoel07
marked this pull request as ready for review
August 5, 2026 11:37
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.
Summary
getStreamVolumeDbVerification that the types are missing
Verified against both released
audio_session0.2.4 and upstreammasterbefore this change:AndroidAudioDeviceTypeends atremoteSubmix, index 25.AndroidAudioDeviceType.values[rawType], so every value above 25 falls back tounknown.device.typeunchanged, so the loss occurs in Dart.Android sources
TYPE_ECHO_REFERENCEat 28.TYPE_MULTICHANNEL_GROUPat 32.TYPE_BLE_HEARING_AID,TYPE_BLE_CENTRAL, andTYPE_BLE_CENTRAL_BROADCAST.Root cause
The platform integer was treated as a Dart enum index. Explicit raw values prevent hidden or future Android constants from shifting later meanings.
Validation
flutter test: 2 tests pass. The tests pass complete MethodChannel device maps through the real decoder for values 26 through 35,-1,36, andnull.getStreamVolumeDbtest verifies Android value 29 is sent even though the Dart enum index differs.flutter analyze: no issues.Physical LE Audio hardware was not available for verification. The attached Android 14 device reports
mLeAudio: nulland an active classic A2DP device, so it cannot reproduce the LE path. The regression tests verify the Dart channel boundary using the exact raw Android integers.Scope
This changes no Kotlin code, Android permission, or manifest entry. Active-route detection and Darwin port support remain separate concerns.
Fixes #185