summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/BluetoothManagerService.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java
index e2a8ca2b99ed..07c904883f9c 100644
--- a/services/core/java/com/android/server/BluetoothManagerService.java
+++ b/services/core/java/com/android/server/BluetoothManagerService.java
@@ -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);