Merge "Make Hearing devices preference always visible" into udc-qpr-dev

This commit is contained in:
Angela Wang
2023-06-01 02:04:50 +00:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 10 deletions

View File

@@ -95,8 +95,7 @@ public class HearingAidHelperTest {
}
@Test
public void isHearingAidSupported_supported_returnTrue() {
mBluetoothAdapter.enable();
public void isHearingAidSupported_ashaSupported_returnTrue() {
mShadowBluetoothAdapter.clearSupportedProfiles();
mShadowBluetoothAdapter.addSupportedProfiles(BluetoothProfile.HEARING_AID);
@@ -104,15 +103,20 @@ public class HearingAidHelperTest {
}
@Test
public void isHearingAidSupported_bluetoothOff_returnFalse() {
public void isHearingAidSupported_hapSupported_returnTrue() {
mShadowBluetoothAdapter.clearSupportedProfiles();
mShadowBluetoothAdapter.addSupportedProfiles(BluetoothProfile.HAP_CLIENT);
assertThat(mHelper.isHearingAidSupported()).isTrue();
}
@Test
public void isHearingAidSupported_unsupported_returnFalse() {
mShadowBluetoothAdapter.clearSupportedProfiles();
mShadowBluetoothAdapter.addSupportedProfiles(BluetoothProfile.HEARING_AID);
mBluetoothAdapter.disable();
assertThat(mHelper.isHearingAidSupported()).isFalse();
}
@Test
public void isAllHearingAidRelatedProfilesReady_allReady_returnTrue() {
when(mHearingAidProfile.isProfileReady()).thenReturn(true);