Shows LE audio hearing aid device in a11y settings page (3/3)
Shows connected hearing aid in a11y settings page whether it's ASHA hearing aid or LE audio hearing aid. Makes sure preference summary is updated as expected when BluetoothHapClient profile connects or disconnects. LE audio hearing aid will be a CSIP set. According to the CSIP spec, we will show the device is active without side information if there is only one device in the CSIP set and show the device is active left and right if both side of hearing aids are in the CSIP set. Bug: 249235823 Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityHearingAidPreferenceControllerTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=HearingAidPairingDialogFragmentTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=HearingAidUtilsTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=AvailableMediaBluetoothDeviceUpdaterTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDetailsPairOtherControllerTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDetailsRelatedToolsControllerTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=ConnectedBluetoothDeviceUpdaterTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=AvailableMediaDeviceGroupControllerTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDevicesSliceTest Change-Id: Ifd66cbd81481a1eb94613d89dfd8df16b8c43ae8
This commit is contained in:
@@ -205,12 +205,11 @@ public class AvailableMediaBluetoothDeviceUpdaterTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onProfileConnectionStateChanged_hearingAidDeviceConnected_notInCall_addPreference()
|
||||
{
|
||||
public void onProfileConnectionStateChanged_ashaHearingAidConnected_notInCall_addPreference() {
|
||||
mAudioManager.setMode(AudioManager.MODE_NORMAL);
|
||||
when(mBluetoothDeviceUpdater.
|
||||
isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true);
|
||||
when(mCachedBluetoothDevice.isConnectedHearingAidDevice()).thenReturn(true);
|
||||
when(mCachedBluetoothDevice.isConnectedAshaHearingAidDevice()).thenReturn(true);
|
||||
|
||||
mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice,
|
||||
BluetoothProfile.STATE_CONNECTED, BluetoothProfile.HEARING_AID);
|
||||
@@ -219,11 +218,11 @@ public class AvailableMediaBluetoothDeviceUpdaterTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onProfileConnectionStateChanged_hearingAidDeviceConnected_inCall_addPreference() {
|
||||
public void onProfileConnectionStateChanged_ashaHearingAidConnected_inCall_addPreference() {
|
||||
mAudioManager.setMode(AudioManager.MODE_IN_CALL);
|
||||
when(mBluetoothDeviceUpdater.
|
||||
isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true);
|
||||
when(mCachedBluetoothDevice.isConnectedHearingAidDevice()).thenReturn(true);
|
||||
when(mCachedBluetoothDevice.isConnectedAshaHearingAidDevice()).thenReturn(true);
|
||||
|
||||
mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice,
|
||||
BluetoothProfile.STATE_CONNECTED, BluetoothProfile.HEARING_AID);
|
||||
|
@@ -81,8 +81,8 @@ public class BluetoothDetailsPairOtherControllerTest extends BluetoothDetailsCon
|
||||
}
|
||||
|
||||
@Test
|
||||
public void init_isNotConnectedHearingAidDevice_notVisiblePreference() {
|
||||
when(mCachedDevice.isConnectedHearingAidDevice()).thenReturn(false);
|
||||
public void init_isNotConnectedAshaHearingAidDevice_notVisiblePreference() {
|
||||
when(mCachedDevice.isConnectedAshaHearingAidDevice()).thenReturn(false);
|
||||
|
||||
mController.init(mScreen);
|
||||
|
||||
@@ -91,35 +91,35 @@ public class BluetoothDetailsPairOtherControllerTest extends BluetoothDetailsCon
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isAvailable_isNotConnectedHearingAidDevice_notAvailable() {
|
||||
when(mCachedDevice.isConnectedHearingAidDevice()).thenReturn(false);
|
||||
public void isAvailable_isNotConnectedAshaHearingAidDevice_notAvailable() {
|
||||
when(mCachedDevice.isConnectedAshaHearingAidDevice()).thenReturn(false);
|
||||
|
||||
assertThat(mController.isAvailable()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isAvailable_notConnectedHearingAidDevice_notAvailable() {
|
||||
when(mCachedDevice.isConnectedHearingAidDevice()).thenReturn(true);
|
||||
public void isAvailable_isConnectedAshaHearingAidDevice_isMonaural_notAvailable() {
|
||||
when(mCachedDevice.isConnectedAshaHearingAidDevice()).thenReturn(true);
|
||||
when(mCachedDevice.getDeviceMode()).thenReturn(HearingAidProfile.DeviceMode.MODE_MONAURAL);
|
||||
|
||||
assertThat(mController.isAvailable()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isAvailable_subDeviceIsConnectedHearingAidDevice_notAvailable() {
|
||||
when(mCachedDevice.isConnectedHearingAidDevice()).thenReturn(true);
|
||||
public void isAvailable_subDeviceIsConnectedAshaHearingAidDevice_notAvailable() {
|
||||
when(mCachedDevice.isConnectedAshaHearingAidDevice()).thenReturn(true);
|
||||
when(mCachedDevice.getDeviceMode()).thenReturn(HearingAidProfile.DeviceMode.MODE_BINAURAL);
|
||||
when(mSubCachedDevice.isConnectedHearingAidDevice()).thenReturn(true);
|
||||
when(mSubCachedDevice.isConnectedAshaHearingAidDevice()).thenReturn(true);
|
||||
when(mCachedDevice.getSubDevice()).thenReturn(mSubCachedDevice);
|
||||
|
||||
assertThat(mController.isAvailable()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isAvailable_subDeviceNotConnectedHearingAidDevice_available() {
|
||||
when(mCachedDevice.isConnectedHearingAidDevice()).thenReturn(true);
|
||||
public void isAvailable_subDeviceIsNotConnectedAshaHearingAidDevice_available() {
|
||||
when(mCachedDevice.isConnectedAshaHearingAidDevice()).thenReturn(true);
|
||||
when(mCachedDevice.getDeviceMode()).thenReturn(HearingAidProfile.DeviceMode.MODE_BINAURAL);
|
||||
when(mSubCachedDevice.isConnectedHearingAidDevice()).thenReturn(false);
|
||||
when(mSubCachedDevice.isConnectedAshaHearingAidDevice()).thenReturn(false);
|
||||
when(mCachedDevice.getSubDevice()).thenReturn(mSubCachedDevice);
|
||||
|
||||
assertThat(mController.isAvailable()).isTrue();
|
||||
@@ -127,7 +127,7 @@ public class BluetoothDetailsPairOtherControllerTest extends BluetoothDetailsCon
|
||||
|
||||
@Test
|
||||
public void isAvailable_subDeviceNotExist_available() {
|
||||
when(mCachedDevice.isConnectedHearingAidDevice()).thenReturn(true);
|
||||
when(mCachedDevice.isConnectedAshaHearingAidDevice()).thenReturn(true);
|
||||
when(mCachedDevice.getDeviceMode()).thenReturn(HearingAidProfile.DeviceMode.MODE_BINAURAL);
|
||||
when(mCachedDevice.getSubDevice()).thenReturn(null);
|
||||
|
||||
@@ -146,8 +146,8 @@ public class BluetoothDetailsPairOtherControllerTest extends BluetoothDetailsCon
|
||||
}
|
||||
|
||||
@Test
|
||||
public void refresh_isNotConnectedHearingAidDevice_notVisiblePreference() {
|
||||
when(mCachedDevice.isConnectedHearingAidDevice()).thenReturn(false);
|
||||
public void refresh_isNotConnectedAshaHearingAidDevice_notVisiblePreference() {
|
||||
when(mCachedDevice.isConnectedAshaHearingAidDevice()).thenReturn(false);
|
||||
mController.init(mScreen);
|
||||
|
||||
mController.refresh();
|
||||
|
@@ -89,7 +89,7 @@ public class BluetoothDetailsRelatedToolsControllerTest extends BluetoothDetails
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isAvailable_notHearingAidDevice_notAvailable() {
|
||||
public void isAvailable_isNotHearingAidDevice_notAvailable() {
|
||||
when(mCachedDevice.isHearingAidDevice()).thenReturn(false);
|
||||
|
||||
assertThat(mController.isAvailable()).isFalse();
|
||||
|
@@ -218,12 +218,12 @@ public class ConnectedBluetoothDeviceUpdaterTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onProfileConnectionStateChanged_hearingAidDeviceConnected_inCall_removePreference()
|
||||
public void onProfileConnectionStateChanged_ashaHearingAidConnected_inCall_removePreference()
|
||||
{
|
||||
mAudioManager.setMode(AudioManager.MODE_IN_CALL);
|
||||
when(mBluetoothDeviceUpdater.
|
||||
isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true);
|
||||
when(mCachedBluetoothDevice.isConnectedHearingAidDevice()).thenReturn(true);
|
||||
when(mCachedBluetoothDevice.isConnectedAshaHearingAidDevice()).thenReturn(true);
|
||||
|
||||
mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice,
|
||||
BluetoothProfile.STATE_CONNECTED, BluetoothProfile.HEARING_AID);
|
||||
@@ -232,12 +232,12 @@ public class ConnectedBluetoothDeviceUpdaterTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onProfileConnectionStateChanged_hearingAidDeviceConnected_notInCall_removePreference
|
||||
() {
|
||||
public void onProfileConnectionStateChanged_ashaHearingAidConnected_notInCall_removePreference()
|
||||
{
|
||||
mAudioManager.setMode(AudioManager.MODE_NORMAL);
|
||||
when(mBluetoothDeviceUpdater.
|
||||
isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true);
|
||||
when(mCachedBluetoothDevice.isConnectedHearingAidDevice()).thenReturn(true);
|
||||
when(mCachedBluetoothDevice.isConnectedAshaHearingAidDevice()).thenReturn(true);
|
||||
|
||||
mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice,
|
||||
BluetoothProfile.STATE_CONNECTED, BluetoothProfile.HEARING_AID);
|
||||
|
Reference in New Issue
Block a user