Index: device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc |
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc b/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc |
index 594303773ae06602ff55644b2728cd34a7d0f7cc..ecab337479bf4658154ba0e97f6fd2e909b9422d 100644 |
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc |
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc |
@@ -21,6 +21,7 @@ |
using base::android::AttachCurrentThread; |
using base::android::JavaParamRef; |
+using base::android::JavaRef; |
namespace device { |
@@ -30,9 +31,10 @@ BluetoothRemoteGattCharacteristicAndroid::Create( |
BluetoothAdapterAndroid* adapter, |
BluetoothRemoteGattServiceAndroid* service, |
const std::string& instance_id, |
- jobject /* BluetoothGattCharacteristicWrapper */ |
+ const JavaRef<jobject>& /* BluetoothGattCharacteristicWrapper */ |
bluetooth_gatt_characteristic_wrapper, |
- jobject /* ChromeBluetoothDevice */ chrome_bluetooth_device) { |
+ const JavaRef< |
+ jobject>& /* ChromeBluetoothDevice */ chrome_bluetooth_device) { |
std::unique_ptr<BluetoothRemoteGattCharacteristicAndroid> characteristic( |
new BluetoothRemoteGattCharacteristicAndroid(adapter, service, |
instance_id)); |
@@ -243,7 +245,7 @@ void BluetoothRemoteGattCharacteristicAndroid::SubscribeToNotifications( |
const base::Closure& callback, |
const ErrorCallback& error_callback) { |
if (!Java_ChromeBluetoothRemoteGattCharacteristic_setCharacteristicNotification( |
- AttachCurrentThread(), j_characteristic_.obj(), true)) { |
+ AttachCurrentThread(), j_characteristic_, true)) { |
LOG(ERROR) << "Error enabling characteristic notification"; |
base::ThreadTaskRunnerHandle::Get()->PostTask( |
FROM_HERE, base::Bind(error_callback, |
@@ -263,7 +265,7 @@ void BluetoothRemoteGattCharacteristicAndroid::UnsubscribeFromNotifications( |
const base::Closure& callback, |
const ErrorCallback& error_callback) { |
if (!Java_ChromeBluetoothRemoteGattCharacteristic_setCharacteristicNotification( |
- AttachCurrentThread(), j_characteristic_.obj(), false)) { |
+ AttachCurrentThread(), j_characteristic_, false)) { |
LOG(ERROR) << "Error disabling characteristic notification"; |
base::ThreadTaskRunnerHandle::Get()->PostTask( |
FROM_HERE, |