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

Commit b4625b17 authored by Arman Uguray's avatar Arman Uguray Committed by Android Git Automerger
Browse files

am 3f7c31fd: service: Check for NULL IBinder in registerCallback

* commit '3f7c31fd':
  service: Check for NULL IBinder in registerCallback
parents 9407e104 3f7c31fd
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -80,12 +80,20 @@ std::string BluetoothBinderServer::GetName() {
void BluetoothBinderServer::RegisterCallback(
    const android::sp<IBluetoothCallback>& callback) {
  VLOG(2) << __func__;
  if (!callback.get() ) {
    LOG(ERROR) << "RegisterCallback called with NULL binder. Ignoring.";
    return;
  }
  callbacks_.Register(callback);
}

void BluetoothBinderServer::UnregisterCallback(
    const android::sp<IBluetoothCallback>& callback) {
  VLOG(2) << __func__;
  if (!callback.get() ) {
    LOG(ERROR) << "UnregisterCallback called with NULL binder. Ignoring.";
    return;
  }
  callbacks_.Unregister(callback);
}