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

Commit 1c9e54b5 authored by Yuyang Huang's avatar Yuyang Huang
Browse files

update HeadsetNativeInterface's getByteAddress to match A2dpNativeInterface's

Bug: 292601390
Change-Id: Id2123b2f930ea5b74eeab5bdae36bfacfccba728
Test: atest GoogleBluetoothInstrumentationTests:com.android.bluetooth.hfp.HeadsetServiceAndStateMachineTest
parent aedd0dfa
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -79,6 +79,10 @@ public class HeadsetNativeInterface {
    }

    private byte[] getByteAddress(BluetoothDevice device) {
        if (device == null) {
            // Set bt_stack's active device to default if java layer set active device to null
            return Utils.getBytesFromAddress("00:00:00:00:00:00");
        }
        return mAdapterService.getByteIdentityAddress(device);
    }

@@ -491,10 +495,6 @@ public class HeadsetNativeInterface {
     */
    @VisibleForTesting
    public boolean setActiveDevice(BluetoothDevice device) {
        // Set bt_stack's active device to default if java layer set active device to null
        if (device == null) {
            return setActiveDeviceNative(Utils.getBytesFromAddress("00:00:00:00:00:00"));
        }
        return setActiveDeviceNative(getByteAddress(device));
    }