Index: device/bluetooth/bluetooth_remote_gatt_service_android.cc |
diff --git a/device/bluetooth/bluetooth_remote_gatt_service_android.cc b/device/bluetooth/bluetooth_remote_gatt_service_android.cc |
index 1f15629b8acc31d7b733aaef52b3c6206579ad3d..734ff89c6903de97a399b160c24ea9b14cfa5043 100644 |
--- a/device/bluetooth/bluetooth_remote_gatt_service_android.cc |
+++ b/device/bluetooth/bluetooth_remote_gatt_service_android.cc |
@@ -19,20 +19,24 @@ namespace device { |
BluetoothRemoteGattServiceAndroid* BluetoothRemoteGattServiceAndroid::Create( |
BluetoothAdapterAndroid* adapter, |
BluetoothDeviceAndroid* device, |
- jobject bluetooth_remote_gatt_service_wrapper, |
+ jobject bluetooth_gatt_service_wrapper, |
const std::string& instanceId) { |
BluetoothRemoteGattServiceAndroid* service = |
new BluetoothRemoteGattServiceAndroid(adapter, device, instanceId); |
- JNIEnv* env = base::android::AttachCurrentThread(); |
+ JNIEnv* env = AttachCurrentThread(); |
service->j_service_.Reset(Java_ChromeBluetoothRemoteGattService_create( |
- env, reinterpret_cast<intptr_t>(service), |
- bluetooth_remote_gatt_service_wrapper, |
+ env, reinterpret_cast<intptr_t>(service), bluetooth_gatt_service_wrapper, |
base::android::ConvertUTF8ToJavaString(env, instanceId).obj())); |
return service; |
} |
+BluetoothRemoteGattServiceAndroid::~BluetoothRemoteGattServiceAndroid() { |
+ Java_ChromeBluetoothRemoteGattService_onBluetoothRemoteGattServiceAndroidDestruction( |
+ AttachCurrentThread(), j_service_.obj()); |
+} |
+ |
// static |
bool BluetoothRemoteGattServiceAndroid::RegisterJNI(JNIEnv* env) { |
return RegisterNativesImpl( |
@@ -136,11 +140,6 @@ BluetoothRemoteGattServiceAndroid::BluetoothRemoteGattServiceAndroid( |
const std::string& instanceId) |
: adapter_(adapter), device_(device), instanceId_(instanceId) {} |
-BluetoothRemoteGattServiceAndroid::~BluetoothRemoteGattServiceAndroid() { |
- Java_ChromeBluetoothRemoteGattService_onBluetoothRemoteGattServiceAndroidDestruction( |
- AttachCurrentThread(), j_service_.obj()); |
-} |
- |
void BluetoothRemoteGattServiceAndroid::EnsureCharacteristicsCreated() const { |
if (!characteristics_.empty()) |
return; |