package com.android.settings.sound;
+import static android.media.AudioManager.DEVICE_OUT_BLUETOOTH_SCO;
+import static android.media.AudioManager.STREAM_RING;
+import static android.media.AudioManager.STREAM_VOICE_CALL;
+import static android.media.AudioSystem.DEVICE_OUT_ALL_SCO;
+import static android.media.AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP;
+import static android.media.AudioSystem.DEVICE_OUT_BLUETOOTH_SCO_HEADSET;
+import static android.media.AudioSystem.DEVICE_OUT_HEARING_AID;
+import static android.media.AudioSystem.STREAM_MUSIC;
+
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_UNAVAILABLE;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import static org.robolectric.Shadows.shadowOf;
+
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothManager;
+import android.content.pm.PackageManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.IntentFilter;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RuntimeEnvironment;
-import org.robolectric.Shadows;
import org.robolectric.annotation.Config;
+import org.robolectric.shadow.api.Shadow;
import org.robolectric.shadows.ShadowBluetoothDevice;
+import org.robolectric.shadows.ShadowPackageManager;
import java.util.ArrayList;
import java.util.List;
private BluetoothManager mBluetoothManager;
private BluetoothAdapter mBluetoothAdapter;
private BluetoothDevice mBluetoothDevice;
- private BluetoothDevice mBluetoothHapDevice;
- private BluetoothDevice mSecondBluetoothHapDevice;
+ private BluetoothDevice mLeftBluetoothHapDevice;
+ private BluetoothDevice mRightBluetoothHapDevice;
private LocalBluetoothManager mLocalBluetoothManager;
private AudioSwitchPreferenceController mController;
- private List<BluetoothDevice> mConnectedDevices;
+ private List<BluetoothDevice> mProfileConnectedDevices;
private List<BluetoothDevice> mHearingAidActiveDevices;
private List<BluetoothDevice> mEmptyDevices;
+ private ShadowPackageManager mPackageManager;
@Before
public void setUp() {
when(mLocalBluetoothProfileManager.getA2dpProfile()).thenReturn(mA2dpProfile);
when(mLocalBluetoothProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile);
when(mLocalBluetoothProfileManager.getHeadsetProfile()).thenReturn(mHeadsetProfile);
+ mPackageManager = Shadow.extract(mContext.getPackageManager());
+ mPackageManager.setSystemFeature(PackageManager.FEATURE_BLUETOOTH, true);
mBluetoothManager = new BluetoothManager(mContext);
mBluetoothAdapter = mBluetoothManager.getAdapter();
when(mBluetoothDevice.getName()).thenReturn(TEST_DEVICE_NAME_1);
when(mBluetoothDevice.isConnected()).thenReturn(true);
- mBluetoothHapDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_2));
- when(mBluetoothHapDevice.isConnected()).thenReturn(true);
- mSecondBluetoothHapDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_3));
- when(mSecondBluetoothHapDevice.isConnected()).thenReturn(true);
+ mLeftBluetoothHapDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_2));
+ when(mLeftBluetoothHapDevice.isConnected()).thenReturn(true);
+ mRightBluetoothHapDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_3));
+ when(mRightBluetoothHapDevice.isConnected()).thenReturn(true);
mController = new AudioSwitchPreferenceControllerTestable(mContext, TEST_KEY);
mScreen = spy(new PreferenceScreen(mContext, null));
mPreference = new ListPreference(mContext);
- mConnectedDevices = new ArrayList<>(2);
+ mProfileConnectedDevices = new ArrayList<>();
mHearingAidActiveDevices = new ArrayList<>(2);
mEmptyDevices = new ArrayList<>(2);
}
@Test
- public void getAvailabilityStatus_byDefault_isAvailable() {
- assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
+ public void constructor_notSupportBluetooth_shouldReturnBeforeUsingLocalBluetoothManager() {
+ ShadowBluetoothUtils.reset();
+ mLocalBluetoothManager = ShadowBluetoothUtils.getLocalBtManager(mContext);
+
+ AudioSwitchPreferenceController controller = new AudioSwitchPreferenceControllerTestable(
+ mContext, TEST_KEY);
+ controller.onStart();
+ controller.onStop();
+
+ assertThat(mLocalBluetoothManager).isNull();
}
@Test
- public void getAvailabilityStatus_whenNotVisible_isDisable() {
+ public void getAvailabilityStatus_disableFlagNoBluetoothFeature_returnUnavailable() {
FeatureFlagUtils.setEnabled(mContext, FeatureFlags.AUDIO_SWITCHER_SETTINGS, false);
+ mPackageManager.setSystemFeature(PackageManager.FEATURE_BLUETOOTH, false);
+
+ assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE);
+ }
+
+ @Test
+ public void getAvailabilityStatus_disableFlagWithBluetoothFeature_returnUnavailable() {
+ FeatureFlagUtils.setEnabled(mContext, FeatureFlags.AUDIO_SWITCHER_SETTINGS, false);
+ mPackageManager.setSystemFeature(PackageManager.FEATURE_BLUETOOTH, true);
+
+
+ assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE);
+ }
+
+ @Test
+ public void getAvailabilityStatus_enableFlagWithBluetoothFeature_returnAvailable() {
+ FeatureFlagUtils.setEnabled(mContext, FeatureFlags.AUDIO_SWITCHER_SETTINGS, true);
+ mPackageManager.setSystemFeature(PackageManager.FEATURE_BLUETOOTH, true);
+
+ assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
+ }
+
+ @Test
+ public void getAvailabilityStatus_enableFlagNoBluetoothFeature_returnUnavailable() {
+ FeatureFlagUtils.setEnabled(mContext, FeatureFlags.AUDIO_SWITCHER_SETTINGS, true);
+ mPackageManager.setSystemFeature(PackageManager.FEATURE_BLUETOOTH, false);
+
assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE);
}
verify(mLocalBluetoothManager.getEventManager()).registerCallback(
any(BluetoothCallback.class));
verify(mContext).registerReceiver(any(BroadcastReceiver.class), any(IntentFilter.class));
+ verify(mLocalBluetoothManager).setForegroundActivity(mContext);
}
@Test
verify(mLocalBluetoothManager.getEventManager()).unregisterCallback(
any(BluetoothCallback.class));
verify(mContext).unregisterReceiver(any(BroadcastReceiver.class));
+ verify(mLocalBluetoothManager).setForegroundActivity(null);
}
@Test
public void onPreferenceChange_toThisDevice_shouldSetDefaultSummary() {
- mConnectedDevices.clear();
- mConnectedDevices.add(mBluetoothDevice);
- mController.mConnectedDevices = mConnectedDevices;
+ mController.mConnectedDevices.clear();
+ mController.mConnectedDevices.add(mBluetoothDevice);
mController.onPreferenceChange(mPreference,
mContext.getText(R.string.media_output_default_summary));
*/
@Test
public void onPreferenceChange_toBtDevice_shouldSetBtDeviceName() {
- mConnectedDevices.clear();
- mConnectedDevices.add(mBluetoothDevice);
- mController.mConnectedDevices = mConnectedDevices;
+ mController.mConnectedDevices.clear();
+ mController.mConnectedDevices.add(mBluetoothDevice);
mController.onPreferenceChange(mPreference, TEST_DEVICE_ADDRESS_1);
- assertThat(mPreference.getSummary()).isEqualTo(mBluetoothDevice.getName());
+ assertThat(mPreference.getSummary()).isEqualTo(TEST_DEVICE_NAME_1);
}
/**
ShadowBluetoothDevice shadowBluetoothDevice;
BluetoothDevice secondBluetoothDevice;
secondBluetoothDevice = mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_2);
- shadowBluetoothDevice = Shadows.shadowOf(secondBluetoothDevice);
+ shadowBluetoothDevice = shadowOf(secondBluetoothDevice);
shadowBluetoothDevice.setName(TEST_DEVICE_NAME_2);
- mConnectedDevices.clear();
- mConnectedDevices.add(mBluetoothDevice);
- mConnectedDevices.add(secondBluetoothDevice);
- mController.mConnectedDevices = mConnectedDevices;
+ mController.mConnectedDevices.clear();
+ mController.mConnectedDevices.add(mBluetoothDevice);
+ mController.mConnectedDevices.add(secondBluetoothDevice);
mController.onPreferenceChange(mPreference, TEST_DEVICE_ADDRESS_2);
- assertThat(mPreference.getSummary()).isEqualTo(secondBluetoothDevice.getName());
+ assertThat(mPreference.getSummary()).isEqualTo(TEST_DEVICE_NAME_2);
}
/**
- * mConnectedDevices is Null.
+ * mConnectedDevices is empty.
* onPreferenceChange should return false.
*/
@Test
public void onPreferenceChange_connectedDeviceIsNull_shouldReturnFalse() {
- mController.mConnectedDevices = null;
+ mController.mConnectedDevices.clear();
assertThat(mController.onPreferenceChange(mPreference, TEST_DEVICE_ADDRESS_1)).isFalse();
}
/**
+ * Audio stream output to bluetooth sco headset which is the subset of all sco device.
+ * isStreamFromOutputDevice should return true.
+ */
+ @Test
+ public void isStreamFromOutputDevice_outputDeviceIsBtScoHeadset_shouldReturnTrue() {
+ mShadowAudioManager.setOutputDevice(DEVICE_OUT_BLUETOOTH_SCO_HEADSET);
+
+ assertThat(mController.isStreamFromOutputDevice(STREAM_MUSIC, DEVICE_OUT_ALL_SCO)).isTrue();
+ }
+
+ /**
+ * Audio stream is not STREAM_MUSIC or STREAM_VOICE_CALL.
+ * findActiveDevice should return null.
+ */
+ @Test
+ public void findActiveDevice_streamIsRing_shouldReturnNull() {
+ assertThat(mController.findActiveDevice(STREAM_RING)).isNull();
+ }
+
+ /**
+ * Audio stream is STREAM_MUSIC and output device is A2dp bluetooth device.
+ * findActiveDevice should return A2dp active device.
+ */
+ @Test
+ public void findActiveDevice_streamMusicToA2dpDevice_shouldReturnActiveA2dpDevice() {
+ mShadowAudioManager.setOutputDevice(DEVICE_OUT_BLUETOOTH_A2DP);
+ mHearingAidActiveDevices.clear();
+ mHearingAidActiveDevices.add(mLeftBluetoothHapDevice);
+ when(mHeadsetProfile.getActiveDevice()).thenReturn(mLeftBluetoothHapDevice);
+ when(mA2dpProfile.getActiveDevice()).thenReturn(mBluetoothDevice);
+ when(mHearingAidProfile.getActiveDevices()).thenReturn(mHearingAidActiveDevices);
+
+ assertThat(mController.findActiveDevice(STREAM_MUSIC)).isEqualTo(mBluetoothDevice);
+ }
+
+ /**
+ * Audio stream is STREAM_VOICE_CALL and output device is Hands free profile bluetooth device.
+ * findActiveDevice should return Hands free profile active device.
+ */
+ @Test
+ public void findActiveDevice_streamVoiceCallToHfpDevice_shouldReturnActiveHfpDevice() {
+ mShadowAudioManager.setOutputDevice(DEVICE_OUT_BLUETOOTH_SCO);
+ mHearingAidActiveDevices.clear();
+ mHearingAidActiveDevices.add(mLeftBluetoothHapDevice);
+ when(mHeadsetProfile.getActiveDevice()).thenReturn(mBluetoothDevice);
+ when(mA2dpProfile.getActiveDevice()).thenReturn(mLeftBluetoothHapDevice);
+ when(mHearingAidProfile.getActiveDevices()).thenReturn(mHearingAidActiveDevices);
+
+ assertThat(mController.findActiveDevice(STREAM_VOICE_CALL)).isEqualTo(mBluetoothDevice);
+ }
+
+ /**
+ * Audio stream is STREAM_MUSIC or STREAM_VOICE_CALL and output device is hearing aid profile
+ * bluetooth device. And left side of HAP device is active.
+ * findActiveDevice should return hearing aid device active device.
+ */
+ @Test
+ public void findActiveDevice_streamToHapDeviceLeftActiveDevice_shouldReturnActiveHapDevice() {
+ mShadowAudioManager.setOutputDevice(DEVICE_OUT_HEARING_AID);
+ mController.mConnectedDevices.clear();
+ mController.mConnectedDevices.add(mBluetoothDevice);
+ mController.mConnectedDevices.add(mLeftBluetoothHapDevice);
+ mHearingAidActiveDevices.clear();
+ mHearingAidActiveDevices.add(mLeftBluetoothHapDevice);
+ mHearingAidActiveDevices.add(null);
+ when(mHeadsetProfile.getActiveDevice()).thenReturn(mBluetoothDevice);
+ when(mA2dpProfile.getActiveDevice()).thenReturn(mBluetoothDevice);
+ when(mHearingAidProfile.getActiveDevices()).thenReturn(mHearingAidActiveDevices);
+
+ assertThat(mController.findActiveDevice(STREAM_MUSIC)).isEqualTo(mLeftBluetoothHapDevice);
+ assertThat(mController.findActiveDevice(STREAM_VOICE_CALL)).isEqualTo(
+ mLeftBluetoothHapDevice);
+ }
+
+ /**
+ * Audio stream is STREAM_MUSIC or STREAM_VOICE_CALL and output device is hearing aid profile
+ * bluetooth device. And right side of HAP device is active.
+ * findActiveDevice should return hearing aid device active device.
+ */
+ @Test
+ public void findActiveDevice_streamToHapDeviceRightActiveDevice_shouldReturnActiveHapDevice() {
+ mShadowAudioManager.setOutputDevice(DEVICE_OUT_HEARING_AID);
+ mController.mConnectedDevices.clear();
+ mController.mConnectedDevices.add(mBluetoothDevice);
+ mController.mConnectedDevices.add(mRightBluetoothHapDevice);
+ mHearingAidActiveDevices.clear();
+ mHearingAidActiveDevices.add(null);
+ mHearingAidActiveDevices.add(mRightBluetoothHapDevice);
+ mHearingAidActiveDevices.add(mRightBluetoothHapDevice);
+ when(mHeadsetProfile.getActiveDevice()).thenReturn(mBluetoothDevice);
+ when(mA2dpProfile.getActiveDevice()).thenReturn(mBluetoothDevice);
+ when(mHearingAidProfile.getActiveDevices()).thenReturn(mHearingAidActiveDevices);
+
+ assertThat(mController.findActiveDevice(STREAM_MUSIC)).isEqualTo(mRightBluetoothHapDevice);
+ assertThat(mController.findActiveDevice(STREAM_VOICE_CALL)).isEqualTo(
+ mRightBluetoothHapDevice);
+ }
+
+ /**
+ * Audio stream is STREAM_MUSIC or STREAM_VOICE_CALL and output device is hearing aid
+ * profile bluetooth device. And both are active device.
+ * findActiveDevice should return only return the active device in mConnectedDevices.
+ */
+ @Test
+ public void findActiveDevice_streamToHapDeviceTwoActiveDevice_shouldReturnActiveHapDevice() {
+ mShadowAudioManager.setOutputDevice(DEVICE_OUT_HEARING_AID);
+ mController.mConnectedDevices.clear();
+ mController.mConnectedDevices.add(mBluetoothDevice);
+ mController.mConnectedDevices.add(mRightBluetoothHapDevice);
+ mHearingAidActiveDevices.clear();
+ mHearingAidActiveDevices.add(mLeftBluetoothHapDevice);
+ mHearingAidActiveDevices.add(mRightBluetoothHapDevice);
+ when(mHeadsetProfile.getActiveDevice()).thenReturn(mBluetoothDevice);
+ when(mA2dpProfile.getActiveDevice()).thenReturn(mBluetoothDevice);
+ when(mHearingAidProfile.getActiveDevices()).thenReturn(mHearingAidActiveDevices);
+
+ assertThat(mController.findActiveDevice(STREAM_MUSIC)).isEqualTo(mRightBluetoothHapDevice);
+ assertThat(mController.findActiveDevice(STREAM_VOICE_CALL)).isEqualTo(
+ mRightBluetoothHapDevice);
+ }
+
+ /**
+ * Audio stream is STREAM_MUSIC or STREAM_VOICE_CALL and output device is hearing aid
+ * profile bluetooth device. And none of them are active.
+ * findActiveDevice should return null.
+ */
+ @Test
+ public void findActiveDevice_streamToOtherDevice_shouldReturnActiveHapDevice() {
+ mShadowAudioManager.setOutputDevice(DEVICE_OUT_HEARING_AID);
+ mController.mConnectedDevices.clear();
+ mController.mConnectedDevices.add(mBluetoothDevice);
+ mController.mConnectedDevices.add(mLeftBluetoothHapDevice);
+ mHearingAidActiveDevices.clear();
+ when(mHeadsetProfile.getActiveDevice()).thenReturn(mBluetoothDevice);
+ when(mA2dpProfile.getActiveDevice()).thenReturn(mBluetoothDevice);
+ when(mHearingAidProfile.getActiveDevices()).thenReturn(mHearingAidActiveDevices);
+
+ assertThat(mController.findActiveDevice(STREAM_MUSIC)).isNull();
+ assertThat(mController.findActiveDevice(STREAM_VOICE_CALL)).isNull();
+ }
+
+ /**
* Two hearing aid devices with different HisyncId
* getConnectedHearingAidDevices should add both device to list.
*/
@Test
public void getConnectedHearingAidDevices_deviceHisyncIdIsDifferent_shouldAddBothToList() {
mEmptyDevices.clear();
- mConnectedDevices.clear();
- mConnectedDevices.add(mBluetoothHapDevice);
- mConnectedDevices.add(mSecondBluetoothHapDevice);
- when(mHearingAidProfile.getConnectedDevices()).thenReturn(mConnectedDevices);
- when(mHearingAidProfile.getHiSyncId(mBluetoothHapDevice)).thenReturn(HISYNCID1);
- when(mHearingAidProfile.getHiSyncId(mSecondBluetoothHapDevice)).thenReturn(
- HISYNCID2);
+ mProfileConnectedDevices.clear();
+ mProfileConnectedDevices.add(mLeftBluetoothHapDevice);
+ mProfileConnectedDevices.add(mRightBluetoothHapDevice);
+ when(mHearingAidProfile.getConnectedDevices()).thenReturn(mProfileConnectedDevices);
+ when(mHearingAidProfile.getHiSyncId(mLeftBluetoothHapDevice)).thenReturn(HISYNCID1);
+ when(mHearingAidProfile.getHiSyncId(mRightBluetoothHapDevice)).thenReturn(HISYNCID2);
mEmptyDevices.addAll(mController.getConnectedHearingAidDevices());
- assertThat(mEmptyDevices).containsExactly(mBluetoothHapDevice, mSecondBluetoothHapDevice);
+ assertThat(mEmptyDevices).containsExactly(mLeftBluetoothHapDevice,
+ mRightBluetoothHapDevice);
}
/**
@Test
public void getConnectedHearingAidDevices_deviceHisyncIdIsSame_shouldAddOneToList() {
mEmptyDevices.clear();
- mConnectedDevices.clear();
- mConnectedDevices.add(mBluetoothHapDevice);
- mConnectedDevices.add(mSecondBluetoothHapDevice);
- when(mHearingAidProfile.getConnectedDevices()).thenReturn(mConnectedDevices);
- when(mHearingAidProfile.getHiSyncId(mBluetoothHapDevice)).thenReturn(HISYNCID1);
- when(mHearingAidProfile.getHiSyncId(mSecondBluetoothHapDevice)).thenReturn(
- HISYNCID1);
+ mProfileConnectedDevices.clear();
+ mProfileConnectedDevices.add(mLeftBluetoothHapDevice);
+ mProfileConnectedDevices.add(mRightBluetoothHapDevice);
+ when(mHearingAidProfile.getConnectedDevices()).thenReturn(mProfileConnectedDevices);
+ when(mHearingAidProfile.getHiSyncId(mLeftBluetoothHapDevice)).thenReturn(HISYNCID1);
+ when(mHearingAidProfile.getHiSyncId(mRightBluetoothHapDevice)).thenReturn(HISYNCID1);
mEmptyDevices.addAll(mController.getConnectedHearingAidDevices());
- assertThat(mEmptyDevices).containsExactly(mBluetoothHapDevice);
+ assertThat(mEmptyDevices).containsExactly(mLeftBluetoothHapDevice);
}
/**
@Test
public void getConnectedA2dpDevices_oneConnectedA2dpDevice_shouldAddDeviceToList() {
mEmptyDevices.clear();
- mConnectedDevices.clear();
- mConnectedDevices.add(mBluetoothDevice);
- when(mA2dpProfile.getConnectedDevices()).thenReturn(mConnectedDevices);
+ mProfileConnectedDevices.clear();
+ mProfileConnectedDevices.add(mBluetoothDevice);
+ when(mA2dpProfile.getConnectedDevices()).thenReturn(mProfileConnectedDevices);
mEmptyDevices.addAll(mController.getConnectedA2dpDevices());
@Test
public void getConnectedA2dpDevices_moreThanOneConnectedA2dpDevice_shouldAddDeviceToList() {
mEmptyDevices.clear();
- mConnectedDevices.clear();
- mConnectedDevices.add(mBluetoothDevice);
- mConnectedDevices.add(mBluetoothHapDevice);
- when(mA2dpProfile.getConnectedDevices()).thenReturn(mConnectedDevices);
+ mProfileConnectedDevices.clear();
+ mProfileConnectedDevices.add(mBluetoothDevice);
+ mProfileConnectedDevices.add(mLeftBluetoothHapDevice);
+ when(mA2dpProfile.getConnectedDevices()).thenReturn(mProfileConnectedDevices);
mEmptyDevices.addAll(mController.getConnectedA2dpDevices());
- assertThat(mEmptyDevices).containsExactly(mBluetoothDevice, mBluetoothHapDevice);
+ assertThat(mEmptyDevices).containsExactly(mBluetoothDevice, mLeftBluetoothHapDevice);
}
/**
@Test
public void getConnectedHfpDevices_oneConnectedHfpDevice_shouldAddDeviceToList() {
mEmptyDevices.clear();
- mConnectedDevices.clear();
- mConnectedDevices.add(mBluetoothDevice);
- when(mHeadsetProfile.getConnectedDevices()).thenReturn(mConnectedDevices);
+ mProfileConnectedDevices.clear();
+ mProfileConnectedDevices.add(mBluetoothDevice);
+ when(mHeadsetProfile.getConnectedDevices()).thenReturn(mProfileConnectedDevices);
mEmptyDevices.addAll(mController.getConnectedHfpDevices());
@Test
public void getConnectedHfpDevices_moreThanOneConnectedHfpDevice_shouldAddDeviceToList() {
mEmptyDevices.clear();
- mConnectedDevices.clear();
- mConnectedDevices.add(mBluetoothDevice);
- mConnectedDevices.add(mBluetoothHapDevice);
- when(mHeadsetProfile.getConnectedDevices()).thenReturn(mConnectedDevices);
+ mProfileConnectedDevices.clear();
+ mProfileConnectedDevices.add(mBluetoothDevice);
+ mProfileConnectedDevices.add(mLeftBluetoothHapDevice);
+ when(mHeadsetProfile.getConnectedDevices()).thenReturn(mProfileConnectedDevices);
mEmptyDevices.addAll(mController.getConnectedHfpDevices());
- assertThat(mEmptyDevices).containsExactly(mBluetoothDevice, mBluetoothHapDevice);
+ assertThat(mEmptyDevices).containsExactly(mBluetoothDevice, mLeftBluetoothHapDevice);
}
private class AudioSwitchPreferenceControllerTestable extends