diff options
author | Andre Eisenbach <eisenbach@google.com> | 2014-07-18 14:38:36 -0700 |
---|---|---|
committer | Andre Eisenbach <eisenbach@google.com> | 2014-07-18 14:38:36 -0700 |
commit | 55d19e495e2b3cd744724f2d12c399217e3c565c (patch) | |
tree | 5e4351afd8a1b77ee2a25953e24addf7270b60b5 /core/java/android/bluetooth | |
parent | 6ce4db0acf9dea297d96424e526092e799f6da84 (diff) | |
download | frameworks_base-55d19e495e2b3cd744724f2d12c399217e3c565c.zip frameworks_base-55d19e495e2b3cd744724f2d12c399217e3c565c.tar.gz frameworks_base-55d19e495e2b3cd744724f2d12c399217e3c565c.tar.bz2 |
Reduce GATT logging output
Change-Id: Iefdf101ac849e45bf50c55ce5999364f5fbd24a4
Diffstat (limited to 'core/java/android/bluetooth')
-rw-r--r-- | core/java/android/bluetooth/BluetoothGatt.java | 38 | ||||
-rw-r--r-- | core/java/android/bluetooth/BluetoothGattServer.java | 17 |
2 files changed, 28 insertions, 27 deletions
diff --git a/core/java/android/bluetooth/BluetoothGatt.java b/core/java/android/bluetooth/BluetoothGatt.java index f8684e1..27f2011 100644 --- a/core/java/android/bluetooth/BluetoothGatt.java +++ b/core/java/android/bluetooth/BluetoothGatt.java @@ -40,7 +40,7 @@ import java.util.UUID; public final class BluetoothGatt implements BluetoothProfile { private static final String TAG = "BluetoothGatt"; private static final boolean DBG = true; - private static final boolean VDBG = true; + private static final boolean VDBG = false; private final Context mContext; private IBluetoothGatt mService; @@ -213,7 +213,7 @@ public final class BluetoothGatt implements BluetoothProfile { */ public void onGetService(String address, int srvcType, int srvcInstId, ParcelUuid srvcUuid) { - if (DBG) Log.d(TAG, "onGetService() - Device=" + address + " UUID=" + srvcUuid); + if (VDBG) Log.d(TAG, "onGetService() - Device=" + address + " UUID=" + srvcUuid); if (!address.equals(mDevice.getAddress())) { return; } @@ -230,7 +230,7 @@ public final class BluetoothGatt implements BluetoothProfile { int srvcInstId, ParcelUuid srvcUuid, int inclSrvcType, int inclSrvcInstId, ParcelUuid inclSrvcUuid) { - if (DBG) Log.d(TAG, "onGetIncludedService() - Device=" + address + if (VDBG) Log.d(TAG, "onGetIncludedService() - Device=" + address + " UUID=" + srvcUuid + " Included=" + inclSrvcUuid); if (!address.equals(mDevice.getAddress())) { @@ -256,7 +256,7 @@ public final class BluetoothGatt implements BluetoothProfile { int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int charProps) { - if (DBG) Log.d(TAG, "onGetCharacteristic() - Device=" + address + " UUID=" + + if (VDBG) Log.d(TAG, "onGetCharacteristic() - Device=" + address + " UUID=" + charUuid); if (!address.equals(mDevice.getAddress())) { @@ -280,7 +280,7 @@ public final class BluetoothGatt implements BluetoothProfile { int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int descrInstId, ParcelUuid descUuid) { - if (DBG) Log.d(TAG, "onGetDescriptor() - Device=" + address + " UUID=" + descUuid); + if (VDBG) Log.d(TAG, "onGetDescriptor() - Device=" + address + " UUID=" + descUuid); if (!address.equals(mDevice.getAddress())) { return; @@ -324,7 +324,7 @@ public final class BluetoothGatt implements BluetoothProfile { public void onCharacteristicRead(String address, int status, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, byte[] value) { - if (DBG) Log.d(TAG, "onCharacteristicRead() - Device=" + address + if (VDBG) Log.d(TAG, "onCharacteristicRead() - Device=" + address + " UUID=" + charUuid + " Status=" + status); if (!address.equals(mDevice.getAddress())) { @@ -376,7 +376,7 @@ public final class BluetoothGatt implements BluetoothProfile { public void onCharacteristicWrite(String address, int status, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid) { - if (DBG) Log.d(TAG, "onCharacteristicWrite() - Device=" + address + if (VDBG) Log.d(TAG, "onCharacteristicWrite() - Device=" + address + " UUID=" + charUuid + " Status=" + status); if (!address.equals(mDevice.getAddress())) { @@ -428,7 +428,7 @@ public final class BluetoothGatt implements BluetoothProfile { int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, byte[] value) { - if (DBG) Log.d(TAG, "onNotify() - Device=" + address + " UUID=" + charUuid); + if (VDBG) Log.d(TAG, "onNotify() - Device=" + address + " UUID=" + charUuid); if (!address.equals(mDevice.getAddress())) { return; @@ -459,7 +459,7 @@ public final class BluetoothGatt implements BluetoothProfile { int charInstId, ParcelUuid charUuid, int descrInstId, ParcelUuid descrUuid, byte[] value) { - if (DBG) Log.d(TAG, "onDescriptorRead() - Device=" + address + " UUID=" + charUuid); + if (VDBG) Log.d(TAG, "onDescriptorRead() - Device=" + address + " UUID=" + charUuid); if (!address.equals(mDevice.getAddress())) { return; @@ -513,7 +513,7 @@ public final class BluetoothGatt implements BluetoothProfile { int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int descrInstId, ParcelUuid descrUuid) { - if (DBG) Log.d(TAG, "onDescriptorWrite() - Device=" + address + " UUID=" + charUuid); + if (VDBG) Log.d(TAG, "onDescriptorWrite() - Device=" + address + " UUID=" + charUuid); if (!address.equals(mDevice.getAddress())) { return; @@ -563,7 +563,7 @@ public final class BluetoothGatt implements BluetoothProfile { * @hide */ public void onExecuteWrite(String address, int status) { - if (DBG) Log.d(TAG, "onExecuteWrite() - Device=" + address + if (VDBG) Log.d(TAG, "onExecuteWrite() - Device=" + address + " status=" + status); if (!address.equals(mDevice.getAddress())) { return; @@ -585,7 +585,7 @@ public final class BluetoothGatt implements BluetoothProfile { * @hide */ public void onReadRemoteRssi(String address, int rssi, int status) { - if (DBG) Log.d(TAG, "onReadRemoteRssi() - Device=" + address + + if (VDBG) Log.d(TAG, "onReadRemoteRssi() - Device=" + address + " rssi=" + rssi + " status=" + status); if (!address.equals(mDevice.getAddress())) { return; @@ -935,7 +935,7 @@ public final class BluetoothGatt implements BluetoothProfile { if ((characteristic.getProperties() & BluetoothGattCharacteristic.PROPERTY_READ) == 0) return false; - if (DBG) Log.d(TAG, "readCharacteristic() - uuid: " + characteristic.getUuid()); + if (VDBG) Log.d(TAG, "readCharacteristic() - uuid: " + characteristic.getUuid()); if (mService == null || mClientIf == 0) return false; BluetoothGattService service = characteristic.getService(); @@ -980,7 +980,7 @@ public final class BluetoothGatt implements BluetoothProfile { && (characteristic.getProperties() & BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE) == 0) return false; - if (DBG) Log.d(TAG, "writeCharacteristic() - uuid: " + characteristic.getUuid()); + if (VDBG) Log.d(TAG, "writeCharacteristic() - uuid: " + characteristic.getUuid()); if (mService == null || mClientIf == 0) return false; BluetoothGattService service = characteristic.getService(); @@ -1023,7 +1023,7 @@ public final class BluetoothGatt implements BluetoothProfile { * @return true, if the read operation was initiated successfully */ public boolean readDescriptor(BluetoothGattDescriptor descriptor) { - if (DBG) Log.d(TAG, "readDescriptor() - uuid: " + descriptor.getUuid()); + if (VDBG) Log.d(TAG, "readDescriptor() - uuid: " + descriptor.getUuid()); if (mService == null || mClientIf == 0) return false; BluetoothGattCharacteristic characteristic = descriptor.getCharacteristic(); @@ -1067,7 +1067,7 @@ public final class BluetoothGatt implements BluetoothProfile { * @return true, if the write operation was initiated successfully */ public boolean writeDescriptor(BluetoothGattDescriptor descriptor) { - if (DBG) Log.d(TAG, "writeDescriptor() - uuid: " + descriptor.getUuid()); + if (VDBG) Log.d(TAG, "writeDescriptor() - uuid: " + descriptor.getUuid()); if (mService == null || mClientIf == 0) return false; BluetoothGattCharacteristic characteristic = descriptor.getCharacteristic(); @@ -1121,7 +1121,7 @@ public final class BluetoothGatt implements BluetoothProfile { * @return true, if the reliable write transaction has been initiated */ public boolean beginReliableWrite() { - if (DBG) Log.d(TAG, "beginReliableWrite() - device: " + mDevice.getAddress()); + if (VDBG) Log.d(TAG, "beginReliableWrite() - device: " + mDevice.getAddress()); if (mService == null || mClientIf == 0) return false; try { @@ -1148,7 +1148,7 @@ public final class BluetoothGatt implements BluetoothProfile { * @return true, if the request to execute the transaction has been sent */ public boolean executeReliableWrite() { - if (DBG) Log.d(TAG, "executeReliableWrite() - device: " + mDevice.getAddress()); + if (VDBG) Log.d(TAG, "executeReliableWrite() - device: " + mDevice.getAddress()); if (mService == null || mClientIf == 0) return false; synchronized(mDeviceBusy) { @@ -1176,7 +1176,7 @@ public final class BluetoothGatt implements BluetoothProfile { * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. */ public void abortReliableWrite() { - if (DBG) Log.d(TAG, "abortReliableWrite() - device: " + mDevice.getAddress()); + if (VDBG) Log.d(TAG, "abortReliableWrite() - device: " + mDevice.getAddress()); if (mService == null || mClientIf == 0) return; try { diff --git a/core/java/android/bluetooth/BluetoothGattServer.java b/core/java/android/bluetooth/BluetoothGattServer.java index fbbc2f7..5a39dd6 100644 --- a/core/java/android/bluetooth/BluetoothGattServer.java +++ b/core/java/android/bluetooth/BluetoothGattServer.java @@ -42,6 +42,7 @@ import java.util.UUID; public final class BluetoothGattServer implements BluetoothProfile { private static final String TAG = "BluetoothGattServer"; private static final boolean DBG = true; + private static final boolean VDBG = false; private final Context mContext; private BluetoothAdapter mAdapter; @@ -83,7 +84,7 @@ public final class BluetoothGattServer implements BluetoothProfile { * @hide */ public void onScanResult(String address, int rssi, byte[] advData) { - if (DBG) Log.d(TAG, "onScanResult() - Device=" + address + " RSSI=" +rssi); + if (VDBG) Log.d(TAG, "onScanResult() - Device=" + address + " RSSI=" +rssi); // no op } @@ -133,7 +134,7 @@ public final class BluetoothGattServer implements BluetoothProfile { ParcelUuid srvcId, int charInstId, ParcelUuid charId) { UUID srvcUuid = srvcId.getUuid(); UUID charUuid = charId.getUuid(); - if (DBG) Log.d(TAG, "onCharacteristicReadRequest() - " + if (VDBG) Log.d(TAG, "onCharacteristicReadRequest() - " + "service=" + srvcUuid + ", characteristic=" + charUuid); BluetoothDevice device = mAdapter.getRemoteDevice(address); @@ -161,7 +162,7 @@ public final class BluetoothGattServer implements BluetoothProfile { UUID srvcUuid = srvcId.getUuid(); UUID charUuid = charId.getUuid(); UUID descrUuid = descrId.getUuid(); - if (DBG) Log.d(TAG, "onCharacteristicReadRequest() - " + if (VDBG) Log.d(TAG, "onCharacteristicReadRequest() - " + "service=" + srvcUuid + ", characteristic=" + charUuid + "descriptor=" + descrUuid); @@ -192,7 +193,7 @@ public final class BluetoothGattServer implements BluetoothProfile { int charInstId, ParcelUuid charId, byte[] value) { UUID srvcUuid = srvcId.getUuid(); UUID charUuid = charId.getUuid(); - if (DBG) Log.d(TAG, "onCharacteristicWriteRequest() - " + if (VDBG) Log.d(TAG, "onCharacteristicWriteRequest() - " + "service=" + srvcUuid + ", characteristic=" + charUuid); BluetoothDevice device = mAdapter.getRemoteDevice(address); @@ -223,7 +224,7 @@ public final class BluetoothGattServer implements BluetoothProfile { UUID srvcUuid = srvcId.getUuid(); UUID charUuid = charId.getUuid(); UUID descrUuid = descrId.getUuid(); - if (DBG) Log.d(TAG, "onDescriptorWriteRequest() - " + if (VDBG) Log.d(TAG, "onDescriptorWriteRequest() - " + "service=" + srvcUuid + ", characteristic=" + charUuid + "descriptor=" + descrUuid); @@ -271,7 +272,7 @@ public final class BluetoothGattServer implements BluetoothProfile { * @hide */ public void onNotificationSent(String address, int status) { - if (DBG) Log.d(TAG, "onNotificationSent() - " + if (VDBG) Log.d(TAG, "onNotificationSent() - " + "device=" + address + ", status=" + status); BluetoothDevice device = mAdapter.getRemoteDevice(address); @@ -490,7 +491,7 @@ public final class BluetoothGattServer implements BluetoothProfile { */ public boolean sendResponse(BluetoothDevice device, int requestId, int status, int offset, byte[] value) { - if (DBG) Log.d(TAG, "sendResponse() - device: " + device.getAddress()); + if (VDBG) Log.d(TAG, "sendResponse() - device: " + device.getAddress()); if (mService == null || mServerIf == 0) return false; try { @@ -522,7 +523,7 @@ public final class BluetoothGattServer implements BluetoothProfile { */ public boolean notifyCharacteristicChanged(BluetoothDevice device, BluetoothGattCharacteristic characteristic, boolean confirm) { - if (DBG) Log.d(TAG, "notifyCharacteristicChanged() - device: " + device.getAddress()); + if (VDBG) Log.d(TAG, "notifyCharacteristicChanged() - device: " + device.getAddress()); if (mService == null || mServerIf == 0) return false; BluetoothGattService service = characteristic.getService(); |