Files
app_Settings/res/layout/hearing_device_input_routing_dialog.xml
jasonwshsu 1258059feb [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
2024-12-23 19:57:39 +08:00

52 lines
2.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2024 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="?android:attr/dialogPreferredPadding"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textDirection="locale"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:text="@string/bluetooth_hearing_device_input_routing_dialog_summary" />
<RadioGroup
android:id="@+id/input_routing_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:checkedButton="@id/input_from_hearing_device">
<RadioButton
android:id="@+id/input_from_hearing_device"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:text="@string/bluetooth_hearing_device_input_routing_hearing_device_option"/>
<RadioButton
android:id="@+id/input_from_builtin_mic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:text="@string/bluetooth_hearing_device_input_routing_builtin_option"/>
</RadioGroup>
</LinearLayout>