| Index: device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java
|
| diff --git a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java
|
| index 5ef691323b78b9b97b3d95102d4951adb5d92fab..1059c039324c7f8f0e17303ebf9f88393a532c36 100644
|
| --- a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java
|
| +++ b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java
|
| @@ -196,6 +196,9 @@ final class ChromeBluetoothDevice {
|
| public void onCharacteristicChanged(
|
| final Wrappers.BluetoothGattCharacteristicWrapper characteristic) {
|
| Log.i(TAG, "device onCharacteristicChanged.");
|
| + // Copy the characteristic's value for this event so that new notifications that
|
| + // arrive before the posted task runs do not affect this event's value.
|
| + final byte[] value = characteristic.getValue();
|
| Wrappers.ThreadUtilsWrapper.getInstance().runOnUiThread(new Runnable() {
|
| @Override
|
| public void run() {
|
| @@ -206,7 +209,7 @@ final class ChromeBluetoothDevice {
|
| // when the event races object destruction.
|
| Log.v(TAG, "onCharacteristicChanged when chromeCharacteristic == null.");
|
| } else {
|
| - chromeCharacteristic.onCharacteristicChanged();
|
| + chromeCharacteristic.onCharacteristicChanged(value);
|
| }
|
| }
|
| });
|
|
|