Loading src/com/android/settings/sound/HandsFreeProfileOutputPreferenceController.java +2 −5 Original line number Diff line number Diff line Loading @@ -93,12 +93,9 @@ public class HandsFreeProfileOutputPreferenceController extends if (hapProfile != null && hfpProfile != null && device == null) { hfpProfile.setActiveDevice(null); hapProfile.setActiveDevice(null); return; } if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) { } else if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) { hapProfile.setActiveDevice(device); } if (hfpProfile != null) { } else if (hfpProfile != null) { hfpProfile.setActiveDevice(device); } } Loading src/com/android/settings/sound/MediaOutputPreferenceController.java +2 −5 Original line number Diff line number Diff line Loading @@ -106,12 +106,9 @@ public class MediaOutputPreferenceController extends AudioSwitchPreferenceContro if (hapProfile != null && a2dpProfile != null && device == null) { hapProfile.setActiveDevice(null); a2dpProfile.setActiveDevice(null); return; } if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) { } else if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) { hapProfile.setActiveDevice(device); } if (a2dpProfile != null) { } else if (a2dpProfile != null) { a2dpProfile.setActiveDevice(device); } } Loading tests/robotests/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceControllerTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; Loading Loading @@ -179,6 +180,7 @@ public class HandsFreeProfileOutputPreferenceControllerTest { mController.setActiveBluetoothDevice(mLeftBluetoothHapDevice); verify(mHearingAidProfile).setActiveDevice(mLeftBluetoothHapDevice); verify(mHeadsetProfile, never()).setActiveDevice(mLeftBluetoothHapDevice); } /** Loading @@ -192,6 +194,7 @@ public class HandsFreeProfileOutputPreferenceControllerTest { mController.setActiveBluetoothDevice(mBluetoothDevice); verify(mHeadsetProfile).setActiveDevice(mBluetoothDevice); verify(mHearingAidProfile, never()).setActiveDevice(mBluetoothDevice); } /** Loading tests/robotests/src/com/android/settings/sound/MediaOutputPreferenceControllerTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; Loading Loading @@ -180,6 +181,7 @@ public class MediaOutputPreferenceControllerTest { mController.setActiveBluetoothDevice(mLeftBluetoothHapDevice); verify(mHearingAidProfile).setActiveDevice(mLeftBluetoothHapDevice); verify(mA2dpProfile, never()).setActiveDevice(mLeftBluetoothHapDevice); } /** Loading @@ -193,6 +195,7 @@ public class MediaOutputPreferenceControllerTest { mController.setActiveBluetoothDevice(mBluetoothDevice); verify(mA2dpProfile).setActiveDevice(mBluetoothDevice); verify(mHearingAidProfile, never()).setActiveDevice(mBluetoothDevice); } /** Loading Loading
src/com/android/settings/sound/HandsFreeProfileOutputPreferenceController.java +2 −5 Original line number Diff line number Diff line Loading @@ -93,12 +93,9 @@ public class HandsFreeProfileOutputPreferenceController extends if (hapProfile != null && hfpProfile != null && device == null) { hfpProfile.setActiveDevice(null); hapProfile.setActiveDevice(null); return; } if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) { } else if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) { hapProfile.setActiveDevice(device); } if (hfpProfile != null) { } else if (hfpProfile != null) { hfpProfile.setActiveDevice(device); } } Loading
src/com/android/settings/sound/MediaOutputPreferenceController.java +2 −5 Original line number Diff line number Diff line Loading @@ -106,12 +106,9 @@ public class MediaOutputPreferenceController extends AudioSwitchPreferenceContro if (hapProfile != null && a2dpProfile != null && device == null) { hapProfile.setActiveDevice(null); a2dpProfile.setActiveDevice(null); return; } if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) { } else if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) { hapProfile.setActiveDevice(device); } if (a2dpProfile != null) { } else if (a2dpProfile != null) { a2dpProfile.setActiveDevice(device); } } Loading
tests/robotests/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceControllerTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; Loading Loading @@ -179,6 +180,7 @@ public class HandsFreeProfileOutputPreferenceControllerTest { mController.setActiveBluetoothDevice(mLeftBluetoothHapDevice); verify(mHearingAidProfile).setActiveDevice(mLeftBluetoothHapDevice); verify(mHeadsetProfile, never()).setActiveDevice(mLeftBluetoothHapDevice); } /** Loading @@ -192,6 +194,7 @@ public class HandsFreeProfileOutputPreferenceControllerTest { mController.setActiveBluetoothDevice(mBluetoothDevice); verify(mHeadsetProfile).setActiveDevice(mBluetoothDevice); verify(mHearingAidProfile, never()).setActiveDevice(mBluetoothDevice); } /** Loading
tests/robotests/src/com/android/settings/sound/MediaOutputPreferenceControllerTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; Loading Loading @@ -180,6 +181,7 @@ public class MediaOutputPreferenceControllerTest { mController.setActiveBluetoothDevice(mLeftBluetoothHapDevice); verify(mHearingAidProfile).setActiveDevice(mLeftBluetoothHapDevice); verify(mA2dpProfile, never()).setActiveDevice(mLeftBluetoothHapDevice); } /** Loading @@ -193,6 +195,7 @@ public class MediaOutputPreferenceControllerTest { mController.setActiveBluetoothDevice(mBluetoothDevice); verify(mA2dpProfile).setActiveDevice(mBluetoothDevice); verify(mHearingAidProfile, never()).setActiveDevice(mBluetoothDevice); } /** Loading