Bluetooth MIC detection logic fixes. Add "Always use Bluetooth mic when available" setting with related state management.#157
Open
Dimowner wants to merge 1 commit into
Conversation
…en available" setting with related state management.
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.
This pull request introduces a new "Always use Bluetooth mic when available" feature, allowing users to automatically enable Bluetooth microphone routing whenever a compatible device is connected. It also improves the reliability and safety of Bluetooth audio routing by centralizing and safeguarding routing state transitions. The changes span UI, preferences, state management, and the audio helper logic.
Bluetooth mic auto-enable feature:
HomeViewModeland persistence in preferences. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Bluetooth audio routing reliability and safety:
disableBluetoothRouting()method inAudioManagerHelper, ensuring that audio mode and device state are only changed when this helper enabled routing, preventing side effects with other apps. [1] [2] [3] [4] [5] [6]isCommunicationDeviceSetflag to avoid clobbering the global audio mode and to safely restore previous audio states. [1] [2]UI and state management updates:
BluetoothMicSelectorand its usages to support the new "always use" checkbox and wire up callbacks for preference changes. [1] [2] [3] [4]Testing and defaults:
false.Minor improvements:
Other bugs fixed in AudioManagerHelper
isn't already active, tracked via a new isCommunicationDeviceSet flag.
routing (which could interfere with, e.g., an ongoing call). All cleanup now goes through one disableBluetoothRouting() that only undoes what the helper actually set.
mode were never reset. Now routing is disabled whenever it's active and the last Bluetooth input device disappears.
immediately when routing is active (API 31+).