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

Commit 05f9e27f authored by Mike Lockwood's avatar Mike Lockwood Committed by Android (Google) Code Review
Browse files

Merge "BluetoothGatt: Print stack trace if an exception occurs in a callback"

parents c3ef4fc0 977f260e
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ public final class BluetoothGatt implements BluetoothProfile {
                try {
                    mCallback.onConnectionStateChange(BluetoothGatt.this, status, profileState);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }

                synchronized(mStateLock) {
@@ -294,7 +294,7 @@ public final class BluetoothGatt implements BluetoothProfile {
                try {
                    mCallback.onServicesDiscovered(BluetoothGatt.this, status);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }
            }

@@ -341,7 +341,7 @@ public final class BluetoothGatt implements BluetoothProfile {
                try {
                    mCallback.onCharacteristicRead(BluetoothGatt.this, characteristic, status);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }
            }

@@ -387,7 +387,7 @@ public final class BluetoothGatt implements BluetoothProfile {
                try {
                    mCallback.onCharacteristicWrite(BluetoothGatt.this, characteristic, status);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }
            }

@@ -418,7 +418,7 @@ public final class BluetoothGatt implements BluetoothProfile {
                try {
                    mCallback.onCharacteristicChanged(BluetoothGatt.this, characteristic);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }
            }

@@ -467,7 +467,7 @@ public final class BluetoothGatt implements BluetoothProfile {
                try {
                    mCallback.onDescriptorRead(BluetoothGatt.this, descriptor, status);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }
            }

@@ -515,7 +515,7 @@ public final class BluetoothGatt implements BluetoothProfile {
                try {
                    mCallback.onDescriptorWrite(BluetoothGatt.this, descriptor, status);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }
            }

@@ -532,7 +532,7 @@ public final class BluetoothGatt implements BluetoothProfile {
                try {
                    mCallback.onReliableWriteCompleted(BluetoothGatt.this, status);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }
            }

@@ -549,7 +549,7 @@ public final class BluetoothGatt implements BluetoothProfile {
                try {
                    mCallback.onReadRemoteRssi(BluetoothGatt.this, rssi, status);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }
            }
        };
+7 −7
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ public final class BluetoothGattServer implements BluetoothProfile {
                                                      connected ? BluetoothProfile.STATE_CONNECTED :
                                                      BluetoothProfile.STATE_DISCONNECTED);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }
            }

@@ -128,7 +128,7 @@ public final class BluetoothGattServer implements BluetoothProfile {
                try {
                    mCallback.onServiceAdded((int)status, service);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }
            }

@@ -154,7 +154,7 @@ public final class BluetoothGattServer implements BluetoothProfile {
                try {
                    mCallback.onCharacteristicReadRequest(device, transId, offset, characteristic);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }
            }

@@ -186,7 +186,7 @@ public final class BluetoothGattServer implements BluetoothProfile {
                try {
                    mCallback.onDescriptorReadRequest(device, transId, offset, descriptor);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }
            }

@@ -214,7 +214,7 @@ public final class BluetoothGattServer implements BluetoothProfile {
                    mCallback.onCharacteristicWriteRequest(device, transId, characteristic,
                                                           isPrep, needRsp, offset, value);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }

            }
@@ -250,7 +250,7 @@ public final class BluetoothGattServer implements BluetoothProfile {
                    mCallback.onDescriptorWriteRequest(device, transId, descriptor,
                                                       isPrep, needRsp, offset, value);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }
            }

@@ -270,7 +270,7 @@ public final class BluetoothGattServer implements BluetoothProfile {
                try {
                    mCallback.onExecuteWrite(device, transId, execWrite);
                } catch (Exception ex) {
                    Log.w(TAG, "Unhandled exception: " + ex);
                    Log.w(TAG, "Unhandled exception in callback", ex);
                }
            }
        };