[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:
@@ -42,6 +42,7 @@ public class BluetoothDetailsHearingDeviceController extends BluetoothDetailsCon
|
||||
|
||||
public static final int ORDER_HEARING_DEVICE_SETTINGS = 1;
|
||||
public static final int ORDER_HEARING_AIDS_PRESETS = 2;
|
||||
public static final int ORDER_HEARING_DEVICE_INPUT_ROUTING = 3;
|
||||
public static final int ORDER_AMBIENT_VOLUME = 4;
|
||||
static final String KEY_HEARING_DEVICE_GROUP = "hearing_device_group";
|
||||
|
||||
@@ -62,10 +63,12 @@ public class BluetoothDetailsHearingDeviceController extends BluetoothDetailsCon
|
||||
@VisibleForTesting
|
||||
void setSubControllers(
|
||||
BluetoothDetailsHearingDeviceSettingsController hearingDeviceSettingsController,
|
||||
BluetoothDetailsHearingAidsPresetsController presetsController) {
|
||||
BluetoothDetailsHearingAidsPresetsController presetsController,
|
||||
BluetoothDetailsHearingDeviceInputRoutingController inputRoutingController) {
|
||||
mControllers.clear();
|
||||
mControllers.add(hearingDeviceSettingsController);
|
||||
mControllers.add(presetsController);
|
||||
mControllers.add(inputRoutingController);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -112,6 +115,11 @@ public class BluetoothDetailsHearingDeviceController extends BluetoothDetailsCon
|
||||
mControllers.add(new BluetoothDetailsAmbientVolumePreferenceController(mContext,
|
||||
mManager, mFragment, mCachedDevice, mLifecycle));
|
||||
}
|
||||
if (com.android.settingslib.flags.Flags.hearingDevicesInputRoutingControl()) {
|
||||
mControllers.add(
|
||||
new BluetoothDetailsHearingDeviceInputRoutingController(mContext, mFragment,
|
||||
mCachedDevice, mLifecycle));
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
Reference in New Issue
Block a user