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

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

Merge "Update the method name from isHfpDevice() to isConnectedHfpDevice()"

parents 1460c30b a025ad38
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1198,7 +1198,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
    /**
     * @return {@code true} if {@code cachedBluetoothDevice} is HFP device
     */
    public boolean isHfpDevice() {
    public boolean isConnectedHfpDevice() {
        HeadsetProfile headsetProfile = mProfileManager.getHeadsetProfile();
        return headsetProfile != null && headsetProfile.getConnectionStatus(mDevice) ==
                BluetoothProfile.STATE_CONNECTED;
+3 −3
Original line number Diff line number Diff line
@@ -556,7 +556,7 @@ public class CachedBluetoothDeviceTest {
        when(mHfpProfile.getConnectionStatus(mDevice)).
                thenReturn(BluetoothProfile.STATE_CONNECTED);

        assertThat(mCachedDevice.isHfpDevice()).isTrue();
        assertThat(mCachedDevice.isConnectedHfpDevice()).isTrue();
    }

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

        assertThat(mCachedDevice.isHfpDevice()).isFalse();
        assertThat(mCachedDevice.isConnectedHfpDevice()).isFalse();
    }

    @Test
@@ -590,7 +590,7 @@ public class CachedBluetoothDeviceTest {
    public void isConnectedHfpDevice_profileIsNull_returnFalse() {
        when(mProfileManager.getHeadsetProfile()).thenReturn(null);

        assertThat(mCachedDevice.isHfpDevice()).isFalse();
        assertThat(mCachedDevice.isConnectedHfpDevice()).isFalse();
    }

    @Test