Loading src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdater.java +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ public class AvailableMediaBluetoothDeviceUpdater extends BluetoothDeviceUpdater // show the bluetooth device that have headset profile. switch (currentAudioProfile) { case BluetoothProfile.A2DP: isFilterMatched = cachedDevice.isA2dpDevice(); isFilterMatched = cachedDevice.isConnectedA2dpDevice(); break; case BluetoothProfile.HEADSET: isFilterMatched = cachedDevice.isHfpDevice(); Loading src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdater.java +1 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ public class ConnectedBluetoothDeviceUpdater extends BluetoothDeviceUpdater { // show the bluetooth device that doesn't have headset profile. switch (currentAudioProfile) { case BluetoothProfile.A2DP: isFilterMatched = !cachedDevice.isA2dpDevice(); isFilterMatched = !cachedDevice.isConnectedA2dpDevice(); break; case BluetoothProfile.HEADSET: isFilterMatched = !cachedDevice.isHfpDevice(); Loading tests/robotests/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdaterTest.java +4 −6 Original line number Diff line number Diff line Loading @@ -35,8 +35,6 @@ import com.android.settings.testutils.shadow.ShadowAudioManager; import com.android.settings.testutils.shadow.ShadowBluetoothAdapter; import com.android.settings.testutils.shadow.ShadowCachedBluetoothDeviceManager; import com.android.settingslib.bluetooth.CachedBluetoothDevice; import com.android.settingslib.bluetooth.HeadsetProfile; import com.android.settingslib.bluetooth.LocalBluetoothProfileManager; import org.junit.Before; import org.junit.Test; Loading Loading @@ -127,7 +125,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mCachedDevices.add(mCachedBluetoothDevice); mBluetoothDeviceUpdater.onAudioModeChanged(); Loading @@ -140,7 +138,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mCachedDevices.add(mCachedBluetoothDevice); mBluetoothDeviceUpdater.onAudioModeChanged(); Loading @@ -153,7 +151,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); Loading @@ -166,7 +164,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); Loading tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mCachedDevices.add(mCachedBluetoothDevice); mBluetoothDeviceUpdater.onAudioModeChanged(); Loading @@ -136,7 +136,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mCachedDevices.add(mCachedBluetoothDevice); mBluetoothDeviceUpdater.onAudioModeChanged(); Loading @@ -149,7 +149,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); Loading @@ -162,7 +162,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); Loading Loading
src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdater.java +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ public class AvailableMediaBluetoothDeviceUpdater extends BluetoothDeviceUpdater // show the bluetooth device that have headset profile. switch (currentAudioProfile) { case BluetoothProfile.A2DP: isFilterMatched = cachedDevice.isA2dpDevice(); isFilterMatched = cachedDevice.isConnectedA2dpDevice(); break; case BluetoothProfile.HEADSET: isFilterMatched = cachedDevice.isHfpDevice(); Loading
src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdater.java +1 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ public class ConnectedBluetoothDeviceUpdater extends BluetoothDeviceUpdater { // show the bluetooth device that doesn't have headset profile. switch (currentAudioProfile) { case BluetoothProfile.A2DP: isFilterMatched = !cachedDevice.isA2dpDevice(); isFilterMatched = !cachedDevice.isConnectedA2dpDevice(); break; case BluetoothProfile.HEADSET: isFilterMatched = !cachedDevice.isHfpDevice(); Loading
tests/robotests/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdaterTest.java +4 −6 Original line number Diff line number Diff line Loading @@ -35,8 +35,6 @@ import com.android.settings.testutils.shadow.ShadowAudioManager; import com.android.settings.testutils.shadow.ShadowBluetoothAdapter; import com.android.settings.testutils.shadow.ShadowCachedBluetoothDeviceManager; import com.android.settingslib.bluetooth.CachedBluetoothDevice; import com.android.settingslib.bluetooth.HeadsetProfile; import com.android.settingslib.bluetooth.LocalBluetoothProfileManager; import org.junit.Before; import org.junit.Test; Loading Loading @@ -127,7 +125,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mCachedDevices.add(mCachedBluetoothDevice); mBluetoothDeviceUpdater.onAudioModeChanged(); Loading @@ -140,7 +138,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mCachedDevices.add(mCachedBluetoothDevice); mBluetoothDeviceUpdater.onAudioModeChanged(); Loading @@ -153,7 +151,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); Loading @@ -166,7 +164,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); Loading
tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mCachedDevices.add(mCachedBluetoothDevice); mBluetoothDeviceUpdater.onAudioModeChanged(); Loading @@ -136,7 +136,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mCachedDevices.add(mCachedBluetoothDevice); mBluetoothDeviceUpdater.onAudioModeChanged(); Loading @@ -149,7 +149,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); Loading @@ -162,7 +162,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true); mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); Loading