Car audio: don't drop volume on an Oboe reopen (null routed type != disconnect)#61
Merged
Conversation
…d type != disconnect), fixing a spurious volume drop to the pre-car level on notification/duck
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.
In the car (BT A2DP), a notification/duck triggers an Oboe stream reopen, which resets the engine's routedDeviceType to -1 until the AudioDeviceCallback re-resolves it. getRoutedDeviceType() then returns null, and routedCarActive() treated null as 'left the car' (
?: return false), scheduling the car-session exit; if the stream was still reopening at the 3s debounce, the exit fired and restored the pre-car volume (e.g. 40%) even though the car never disconnected. The user had to re-raise it with the volume rocker.Fix: a null routed type is 'resolving', not a disconnect (a real disconnect resolves to a concrete builtin type). routedCarActive() now bails only on a concrete non-BT type; null or a BT type falls through to the connected-car-sink truth, mirroring how resolveCarKey handles a null routed key on entry (the entry/exit asymmetry was the bug). Confirmed against the 13:55 field log (car-audio active->gone in 3s with no BT disconnect). +1 regression test.
🤖 Generated with Claude Code