Unifies constants accross hearing aid related profiles (2/2)
Hearing aid constants defined differently across different hearing aid related profiles. For hearing aid device mode, HearingAidProfile and HapClientProfile have different values for mode definition and there is also a new BANDED hearing aid type in HapClientProfile spec. For hearing aid device side, HearingAidProfile has only 2 kinds of side which is left and right whereas BLE hearing aid can retrieve 27 different kinds of audio location. We therefore introduce a new class HearingAidInfo for mapping these different constants across these profiles into a single unified set of constants. Bug: 253192350 Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityHearingAidPreferenceControllerTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=HearingAidPairingDialogFragmentTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=HearingAidUtilsTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDetailsPairOtherControllerTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=AvailableMediaDeviceGroupControllerTest Change-Id: Id14928dbc051fcf76fe0d66b43aefefb1b5f7baf
This commit is contained in:
@@ -31,7 +31,7 @@ import com.android.settings.R;
|
||||
import com.android.settings.core.SubSettingLauncher;
|
||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||
import com.android.settingslib.bluetooth.HearingAidProfile;
|
||||
import com.android.settingslib.bluetooth.HearingAidInfo;
|
||||
import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
||||
|
||||
/**
|
||||
@@ -95,10 +95,10 @@ public class HearingAidPairingDialogFragment extends InstrumentedDialogFragment
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
final int deviceSide = mDevice.getDeviceSide();
|
||||
final int titleId = R.string.bluetooth_pair_other_ear_dialog_title;
|
||||
final int messageId = (deviceSide == HearingAidProfile.DeviceSide.SIDE_LEFT)
|
||||
final int messageId = (deviceSide == HearingAidInfo.DeviceSide.SIDE_LEFT)
|
||||
? R.string.bluetooth_pair_other_ear_dialog_left_ear_message
|
||||
: R.string.bluetooth_pair_other_ear_dialog_right_ear_message;
|
||||
final int pairBtnId = (deviceSide == HearingAidProfile.DeviceSide.SIDE_LEFT)
|
||||
final int pairBtnId = (deviceSide == HearingAidInfo.DeviceSide.SIDE_LEFT)
|
||||
? R.string.bluetooth_pair_other_ear_dialog_right_ear_positive_button
|
||||
: R.string.bluetooth_pair_other_ear_dialog_left_ear_positive_button;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user