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

Commit 0cd2ecc1 authored by timhypeng's avatar timhypeng Committed by tim peng
Browse files

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

- the function is to check A2dp connection status

Bug: 110072747
Test: make -j50 RunSettingsLibRoboTests
Change-Id: I3be9c6528e978a3741781c8e6424f5e97fc36017
parent d2c2b0d3
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