[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

@@ -180,6 +180,16 @@
<string name="bluetooth_ambient_volume_unmute">Unmute surroundings</string>
<!-- Message when changing ambient state failed. [CHAR LIMIT=NONE] -->
<string name="bluetooth_ambient_volume_error">Couldn\u2019t update surroundings</string>
<!-- Connected devices settings. Title for hearing device input routing control preference. -->
<string name="bluetooth_hearing_device_input_routing_title">Default microphone for calls</string>
<!-- Connected devices settings. Title for hearing device input routing control dialog. -->
<string name="bluetooth_hearing_device_input_routing_dialog_title">Default microphone</string>
<!-- Connected devices settings. Summary for hearing device input routing control dialog. -->
<string name="bluetooth_hearing_device_input_routing_dialog_summary">Choose a microphone for calls.</string>
<!-- Connected devices settings. One of the input routing option. It will change input routing to hearing aid microphone. -->
<string name="bluetooth_hearing_device_input_routing_hearing_device_option">Hearing aid microphone</string>
<!-- Connected devices settings. One of the input routing option. It will change input routing to this phone's builtin microphone -->
<string name="bluetooth_hearing_device_input_routing_builtin_option">This phone\'s microphone</string>
<!-- Connected devices settings. Title of the preference to show the entrance of the audio output page. It can change different types of audio are played on phone or other bluetooth devices. [CHAR LIMIT=35] -->
<string name="bluetooth_audio_routing_title">Audio output</string>
<!-- Title for bluetooth audio routing page footer. [CHAR LIMIT=30] -->