Update the method name from isA2dpDevice() to isConnectedA2dpDevice()

Bug: 110072747
Test: make -j50 RunSettingsRoboTests
Change-Id: Id3ceb3a62b888a2bde82a1372edf26454e525ea1
This commit is contained in:
timhypeng
2018-08-20 15:53:37 +08:00
parent 6fdf8c225d
commit 156d52e14f
4 changed files with 10 additions and 12 deletions

View File

@@ -81,7 +81,7 @@ public class AvailableMediaBluetoothDeviceUpdater extends BluetoothDeviceUpdater
// show the bluetooth device that have headset profile. // show the bluetooth device that have headset profile.
switch (currentAudioProfile) { switch (currentAudioProfile) {
case BluetoothProfile.A2DP: case BluetoothProfile.A2DP:
isFilterMatched = cachedDevice.isA2dpDevice(); isFilterMatched = cachedDevice.isConnectedA2dpDevice();
break; break;
case BluetoothProfile.HEADSET: case BluetoothProfile.HEADSET:
isFilterMatched = cachedDevice.isHfpDevice(); isFilterMatched = cachedDevice.isHfpDevice();

View File

@@ -82,7 +82,7 @@ public class ConnectedBluetoothDeviceUpdater extends BluetoothDeviceUpdater {
// show the bluetooth device that doesn't have headset profile. // show the bluetooth device that doesn't have headset profile.
switch (currentAudioProfile) { switch (currentAudioProfile) {
case BluetoothProfile.A2DP: case BluetoothProfile.A2DP:
isFilterMatched = !cachedDevice.isA2dpDevice(); isFilterMatched = !cachedDevice.isConnectedA2dpDevice();
break; break;
case BluetoothProfile.HEADSET: case BluetoothProfile.HEADSET:
isFilterMatched = !cachedDevice.isHfpDevice(); isFilterMatched = !cachedDevice.isHfpDevice();

View File

@@ -35,8 +35,6 @@ import com.android.settings.testutils.shadow.ShadowAudioManager;
import com.android.settings.testutils.shadow.ShadowBluetoothAdapter; import com.android.settings.testutils.shadow.ShadowBluetoothAdapter;
import com.android.settings.testutils.shadow.ShadowCachedBluetoothDeviceManager; import com.android.settings.testutils.shadow.ShadowCachedBluetoothDeviceManager;
import com.android.settingslib.bluetooth.CachedBluetoothDevice; 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.Before;
import org.junit.Test; import org.junit.Test;
@@ -127,7 +125,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest {
mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL);
when(mBluetoothDeviceUpdater. when(mBluetoothDeviceUpdater.
isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true);
when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true);
mCachedDevices.add(mCachedBluetoothDevice); mCachedDevices.add(mCachedBluetoothDevice);
mBluetoothDeviceUpdater.onAudioModeChanged(); mBluetoothDeviceUpdater.onAudioModeChanged();
@@ -140,7 +138,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest {
mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); mShadowAudioManager.setMode(AudioManager.MODE_NORMAL);
when(mBluetoothDeviceUpdater. when(mBluetoothDeviceUpdater.
isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true);
when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true);
mCachedDevices.add(mCachedBluetoothDevice); mCachedDevices.add(mCachedBluetoothDevice);
mBluetoothDeviceUpdater.onAudioModeChanged(); mBluetoothDeviceUpdater.onAudioModeChanged();
@@ -153,7 +151,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest {
mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); mShadowAudioManager.setMode(AudioManager.MODE_NORMAL);
when(mBluetoothDeviceUpdater. when(mBluetoothDeviceUpdater.
isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true);
when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true);
mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice,
BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP);
@@ -166,7 +164,7 @@ public class AvailableMediaBluetoothDeviceUpdaterTest {
mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL);
when(mBluetoothDeviceUpdater. when(mBluetoothDeviceUpdater.
isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true);
when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true);
mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice,
BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP);

View File

@@ -123,7 +123,7 @@ public class ConnectedBluetoothDeviceUpdaterTest {
mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); mShadowAudioManager.setMode(AudioManager.MODE_NORMAL);
when(mBluetoothDeviceUpdater. when(mBluetoothDeviceUpdater.
isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true);
when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true);
mCachedDevices.add(mCachedBluetoothDevice); mCachedDevices.add(mCachedBluetoothDevice);
mBluetoothDeviceUpdater.onAudioModeChanged(); mBluetoothDeviceUpdater.onAudioModeChanged();
@@ -136,7 +136,7 @@ public class ConnectedBluetoothDeviceUpdaterTest {
mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL);
when(mBluetoothDeviceUpdater. when(mBluetoothDeviceUpdater.
isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true);
when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true);
mCachedDevices.add(mCachedBluetoothDevice); mCachedDevices.add(mCachedBluetoothDevice);
mBluetoothDeviceUpdater.onAudioModeChanged(); mBluetoothDeviceUpdater.onAudioModeChanged();
@@ -149,7 +149,7 @@ public class ConnectedBluetoothDeviceUpdaterTest {
mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL); mShadowAudioManager.setMode(AudioManager.MODE_IN_CALL);
when(mBluetoothDeviceUpdater. when(mBluetoothDeviceUpdater.
isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true);
when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true);
mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice,
BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP);
@@ -162,7 +162,7 @@ public class ConnectedBluetoothDeviceUpdaterTest {
mShadowAudioManager.setMode(AudioManager.MODE_NORMAL); mShadowAudioManager.setMode(AudioManager.MODE_NORMAL);
when(mBluetoothDeviceUpdater. when(mBluetoothDeviceUpdater.
isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true); isDeviceConnected(any(CachedBluetoothDevice.class))).thenReturn(true);
when(mCachedBluetoothDevice.isA2dpDevice()).thenReturn(true); when(mCachedBluetoothDevice.isConnectedA2dpDevice()).thenReturn(true);
mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice, mBluetoothDeviceUpdater.onProfileConnectionStateChanged(mCachedBluetoothDevice,
BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP); BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP);