Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc788c8d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents e7423111 0cd2ecc1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1189,7 +1189,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
    /**
     * @return {@code true} if {@code cachedBluetoothDevice} is a2dp device
     */
    public boolean isA2dpDevice() {
    public boolean isConnectedA2dpDevice() {
        A2dpProfile a2dpProfile = mProfileManager.getA2dpProfile();
        return a2dpProfile != null && a2dpProfile.getConnectionStatus(mDevice) ==
                BluetoothProfile.STATE_CONNECTED;
+3 −3
Original line number Diff line number Diff line
@@ -538,7 +538,7 @@ public class CachedBluetoothDeviceTest {
        when(mA2dpProfile.getConnectionStatus(mDevice)).
                thenReturn(BluetoothProfile.STATE_CONNECTED);

        assertThat(mCachedDevice.isA2dpDevice()).isTrue();
        assertThat(mCachedDevice.isConnectedA2dpDevice()).isTrue();
    }

    @Test
@@ -547,7 +547,7 @@ public class CachedBluetoothDeviceTest {
        when(mA2dpProfile.getConnectionStatus(mDevice)).
                thenReturn(BluetoothProfile.STATE_DISCONNECTING);

        assertThat(mCachedDevice.isA2dpDevice()).isFalse();
        assertThat(mCachedDevice.isConnectedA2dpDevice()).isFalse();
    }

    @Test
@@ -597,7 +597,7 @@ public class CachedBluetoothDeviceTest {
    public void isConnectedA2dpDevice_profileIsNull_returnFalse() {
        when(mProfileManager.getA2dpProfile()).thenReturn(null);

        assertThat(mCachedDevice.isA2dpDevice()).isFalse();
        assertThat(mCachedDevice.isConnectedA2dpDevice()).isFalse();
    }

    @Test