Merge "Null checks in register/unregister BT Adapters"
diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java
index e2a8ca2..07c9048 100644
--- a/services/core/java/com/android/server/BluetoothManagerService.java
+++ b/services/core/java/com/android/server/BluetoothManagerService.java
@@ -308,6 +308,10 @@
}
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 @@
}
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);