Fix incorrect API invoke for BT profiles

When hearing aid device has been set active, we shouldn't invoke
1. a2dpProfile.setActiveDevice()
2. hfpProfile.setActiveDevice()

Change-Id: Ie13dea041dd98d0cb9d913e1f28574b300095db9
Fixes: 113625278
Test: RunSettingsRoboTests
This commit is contained in:
jackqdyulei
2018-09-18 15:07:49 -07:00
parent e5791f3c99
commit 1bf730093c
4 changed files with 10 additions and 10 deletions

View File

@@ -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;
@@ -180,6 +181,7 @@ public class MediaOutputPreferenceControllerTest {
mController.setActiveBluetoothDevice(mLeftBluetoothHapDevice);
verify(mHearingAidProfile).setActiveDevice(mLeftBluetoothHapDevice);
verify(mA2dpProfile, never()).setActiveDevice(mLeftBluetoothHapDevice);
}
/**
@@ -193,6 +195,7 @@ public class MediaOutputPreferenceControllerTest {
mController.setActiveBluetoothDevice(mBluetoothDevice);
verify(mA2dpProfile).setActiveDevice(mBluetoothDevice);
verify(mHearingAidProfile, never()).setActiveDevice(mBluetoothDevice);
}
/**