Merge "Show battery info for mono audio location device" into main

This commit is contained in:
Angela Wang
2024-12-10 03:38:31 +00:00
committed by Android (Google) Code Review
4 changed files with 43 additions and 12 deletions

View File

@@ -208,7 +208,24 @@ public class AccessibilityHearingAidPreferenceControllerTest {
ShadowLooper.idleMainLooper();
assertThat(mHearingAidPreference.getSummary().toString().contentEquals(
"TEST_HEARING_AID_BT_DEVICE_NAME / Left and right")).isTrue();
"TEST_HEARING_AID_BT_DEVICE_NAME active")).isTrue();
}
@Test
public void getSummary_connectedLeAudioHearingAidMonoSide_connectedSummary() {
when(mCachedBluetoothDevice.getDeviceSide()).thenReturn(
HearingAidInfo.DeviceSide.SIDE_MONO);
when(mCachedBluetoothDevice.getMemberDevice()).thenReturn(new HashSet<>());
when(mHapClientProfile.getConnectedDevices()).thenReturn(generateHearingAidDeviceList());
mPreferenceController.onStart();
Intent intent = new Intent(BluetoothHapClient.ACTION_HAP_CONNECTION_STATE_CHANGED);
intent.putExtra(BluetoothHearingAid.EXTRA_STATE, BluetoothHapClient.STATE_CONNECTED);
sendIntent(intent);
ShadowLooper.idleMainLooper();
assertThat(mHearingAidPreference.getSummary().toString().contentEquals(
"TEST_HEARING_AID_BT_DEVICE_NAME active")).isTrue();
}
@Test