diff --git a/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdater.java b/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdater.java index 8682925efa9..7386c4ab029 100644 --- a/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdater.java +++ b/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdater.java @@ -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.isConnectedHfpDevice(); diff --git a/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdater.java b/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdater.java index 98eadceff16..40ebfabe822 100644 --- a/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdater.java +++ b/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdater.java @@ -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.isConnectedHfpDevice(); diff --git a/tests/robotests/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdaterTest.java b/tests/robotests/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdaterTest.java index 8649d89deba..0b7853c665e 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdaterTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdaterTest.java @@ -125,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(); @@ -138,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(); @@ -151,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); @@ -164,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); diff --git a/tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java b/tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java index cff5ee9cbae..a86f3f3d75c 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java @@ -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(); @@ -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(); @@ -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); @@ -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);