diff --git a/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdater.java b/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdater.java index c2e6f2f8d89..8682925efa9 100644 --- a/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdater.java +++ b/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdater.java @@ -84,7 +84,7 @@ public class AvailableMediaBluetoothDeviceUpdater extends BluetoothDeviceUpdater isFilterMatched = cachedDevice.isA2dpDevice(); break; case BluetoothProfile.HEADSET: - isFilterMatched = cachedDevice.isHfpDevice(); + isFilterMatched = cachedDevice.isConnectedHfpDevice(); break; } if (DBG) { diff --git a/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdater.java b/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdater.java index b66b286b0fd..98eadceff16 100644 --- a/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdater.java +++ b/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdater.java @@ -85,7 +85,7 @@ public class ConnectedBluetoothDeviceUpdater extends BluetoothDeviceUpdater { isFilterMatched = !cachedDevice.isA2dpDevice(); break; case BluetoothProfile.HEADSET: - isFilterMatched = !cachedDevice.isHfpDevice(); + isFilterMatched = !cachedDevice.isConnectedHfpDevice(); break; } if (DBG) { diff --git a/tests/robotests/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdaterTest.java b/tests/robotests/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdaterTest.java index 14d9ca79d01..8649d89deba 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdaterTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdaterTest.java @@ -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; @@ -101,7 +99,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); - when(mCachedBluetoothDevice.isHfpDevice()).thenReturn(true); + when(mCachedBluetoothDevice.isConnectedHfpDevice()).thenReturn(true); mCachedDevices.add(mCachedBluetoothDevice); mBluetoothDeviceUpdater.onAudioModeChanged(); @@ -114,7 +112,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); - when(mCachedBluetoothDevice.isHfpDevice()).thenReturn(true); + when(mCachedBluetoothDevice.isConnectedHfpDevice()).thenReturn(true); mCachedDevices.add(mCachedBluetoothDevice); mBluetoothDeviceUpdater.onAudioModeChanged(); @@ -179,7 +177,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); - when(mCachedBluetoothDevice.isHfpDevice()).thenReturn(true); + when(mCachedBluetoothDevice.isConnectedHfpDevice()).thenReturn(true); mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); @@ -192,7 +190,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); - when(mCachedBluetoothDevice.isHfpDevice()).thenReturn(true); + when(mCachedBluetoothDevice.isConnectedHfpDevice()).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 6faea9a2334..cff5ee9cbae 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdaterTest.java @@ -97,7 +97,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); - when(mCachedBluetoothDevice.isHfpDevice()).thenReturn(true); + when(mCachedBluetoothDevice.isConnectedHfpDevice()).thenReturn(true); mCachedDevices.add(mCachedBluetoothDevice); mBluetoothDeviceUpdater.onAudioModeChanged(); @@ -110,7 +110,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); - when(mCachedBluetoothDevice.isHfpDevice()).thenReturn(true); + when(mCachedBluetoothDevice.isConnectedHfpDevice()).thenReturn(true); mCachedDevices.add(mCachedBluetoothDevice); mBluetoothDeviceUpdater.onAudioModeChanged(); @@ -175,7 +175,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); - when(mCachedBluetoothDevice.isHfpDevice()).thenReturn(true); + when(mCachedBluetoothDevice.isConnectedHfpDevice()).thenReturn(true); mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); @@ -188,7 +188,7 @@ public class ConnectedBluetoothDeviceUpdaterTest { mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); when(mBluetoothDeviceUpdater. isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); - when(mCachedBluetoothDevice.isHfpDevice()).thenReturn(true); + when(mCachedBluetoothDevice.isConnectedHfpDevice()).thenReturn(true); mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP);