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

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

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

- the function is to check Hfp connection status

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