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

Commit bc8169b0 authored by Natalie Silvanovich's avatar Natalie Silvanovich Committed by Android (Google) Code Review
Browse files

Merge "Null checks in register/unregister BT Adapters"

parents f31c1da4 55db646c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -308,6 +308,10 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
    }

    public IBluetooth registerAdapter(IBluetoothManagerCallback callback){
        if (callback == null) {
            Log.w(TAG, "Callback is null in registerAdapter");
            return null;
        }
        Message msg = mHandler.obtainMessage(MESSAGE_REGISTER_ADAPTER);
        msg.obj = callback;
        mHandler.sendMessage(msg);
@@ -317,6 +321,10 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
    }

    public void unregisterAdapter(IBluetoothManagerCallback callback) {
        if (callback == null) {
            Log.w(TAG, "Callback is null in unregisterAdapter");
            return;
        }
        mContext.enforceCallingOrSelfPermission(BLUETOOTH_PERM,
                                                "Need BLUETOOTH permission");
        Message msg = mHandler.obtainMessage(MESSAGE_UNREGISTER_ADAPTER);