Log permission check failure as warning
Currently when permission check fails, there is no way for users to see
what went wrong. This patch fixes that by providing better log message.
Bug: 28328321
Change-Id: I11f336c6c0560c4be482fefefaf95b70a06a63d6
diff --git a/src/com/android/bluetooth/gatt/GattService.java b/src/com/android/bluetooth/gatt/GattService.java
index 3c9220f..3051edb 100644
--- a/src/com/android/bluetooth/gatt/GattService.java
+++ b/src/com/android/bluetooth/gatt/GattService.java
@@ -801,7 +801,7 @@
+ ", handle=" + handle + ", length=" + data.length);
if (!permissionCheck(connId, handle)) {
- if (VDBG) Log.d(TAG, "onNotify() - permission check failed!");
+ Log.w(TAG, "onNotify() - permission check failed!");
return;
}
@@ -1449,7 +1449,7 @@
}
if (!permissionCheck(connId, handle)) {
- if (VDBG) Log.d(TAG, "readCharacteristic() - permission check failed!");
+ Log.w(TAG, "readCharacteristic() - permission check failed!");
return;
}
@@ -1471,7 +1471,7 @@
}
if (!permissionCheck(connId, handle)) {
- if (VDBG) Log.d(TAG, "writeCharacteristic() - permission check failed!");
+ Log.w(TAG, "writeCharacteristic() - permission check failed!");
return;
}
@@ -1490,7 +1490,7 @@
}
if (!permissionCheck(connId, handle)) {
- if (VDBG) Log.d(TAG, "readDescriptor() - permission check failed!");
+ Log.w(TAG, "readDescriptor() - permission check failed!");
return;
}
@@ -1509,7 +1509,7 @@
}
if (!permissionCheck(connId, handle)) {
- if (VDBG) Log.d(TAG, "writeDescriptor() - permission check failed!");
+ Log.w(TAG, "writeDescriptor() - permission check failed!");
return;
}
@@ -1546,7 +1546,7 @@
}
if (!permissionCheck(connId, handle)) {
- if (VDBG) Log.d(TAG, "writeDescriptor() - permission check failed!");
+ Log.w(TAG, "registerForNotification() - permission check failed!");
return;
}