[HA Input] Add UI to support hearing device microphone change ability in device details page

In this patch:
* Add custom dialog preference: HearingDeviceInputRoutingPreference and its controller
* Contain radio group to show 'hearing device microphone' and 'this phone's microphone' for user's preference
* set/get user's preference via BluetoothDevice#isMicrophonePreferredForCalls, BluetoothDevicwe#setMicrophonePreferredForCalls
* check if support HapProfile and if in AudioManager#getDevice(GET_DEVICES_INPUTS) list

Bug: 349255906
Test: atest HearingDeviceInputRoutingPreferenceTest BluetoothDetailsHearingDeviceInputRoutingControllerTest BluetoothDetailsHearingDeviceControllerTest
Flag: com.android.settingslib.flags.hearing_devices_input_routing_control
Change-Id: I2e4dbc7fb98353ed52d0d175df4e8725df6b9a05
This commit is contained in:
jasonwshsu
2024-11-13 16:58:03 +08:00
parent 597b3c6480
commit 1258059feb
10 changed files with 687 additions and 5 deletions

View File

@@ -101,7 +101,7 @@ public abstract class HearingDeviceAudioRoutingBasePreferenceController extends
final List<AudioProductStrategy> supportedStrategies =
mAudioRoutingHelper.getSupportedStrategies(audioAttributes);
final AudioDeviceAttributes hearingDeviceAttributes =
mAudioRoutingHelper.getMatchedHearingDeviceAttributes(hearingDevice);
mAudioRoutingHelper.getMatchedHearingDeviceAttributesForOutput(hearingDevice);
if (hearingDeviceAttributes == null) {
if (DEBUG) {
Log.d(TAG,