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

Commit bed99db5 authored by William Escande's avatar William Escande
Browse files

Pan: Explicitly require address not to be null

Bug: 295103561
Test: atest PanServiceTest
Change-Id: I79e83e8fb60c88a2920b33af9f97e14d060bee03
parent 2cfa99a6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.bluetooth.pan;

import static java.util.Objects.requireNonNull;

import android.bluetooth.BluetoothPan;
import android.bluetooth.BluetoothProfile;
import android.util.Log;
@@ -72,11 +74,13 @@ public class PanNativeInterface {
    }

    boolean connect(byte[] identityAddress) {
        requireNonNull(identityAddress, "Identity address can not be null");
        return connectPanNative(
                identityAddress, BluetoothPan.LOCAL_PANU_ROLE, BluetoothPan.REMOTE_NAP_ROLE);
    }

    boolean disconnect(byte[] identityAddress) {
        requireNonNull(identityAddress, "Identity address can not be null");
        return disconnectPanNative(identityAddress);
    }