Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Unified Diff: device/bluetooth/bluetooth_remote_gatt_service_android.cc

Issue 1412963004: bluetooth: android: Implement Characteristic GetIdentifier, fix Service IDs too. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_service_android.h ('k') | device/device_tests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b5bc1a55bd185cce83874ada03d1029d237668e3..1f15629b8acc31d7b733aaef52b3c6206579ad3d 100644
--- a/device/bluetooth/bluetooth_remote_gatt_service_android.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_service_android.cc
@@ -20,13 +20,15 @@ BluetoothRemoteGattServiceAndroid* BluetoothRemoteGattServiceAndroid::Create(
BluetoothAdapterAndroid* adapter,
BluetoothDeviceAndroid* device,
jobject bluetooth_remote_gatt_service_wrapper,
- std::string instanceId) {
+ const std::string& instanceId) {
BluetoothRemoteGattServiceAndroid* service =
new BluetoothRemoteGattServiceAndroid(adapter, device, instanceId);
+ JNIEnv* env = base::android::AttachCurrentThread();
service->j_service_.Reset(Java_ChromeBluetoothRemoteGattService_create(
- AttachCurrentThread(), reinterpret_cast<intptr_t>(service),
- bluetooth_remote_gatt_service_wrapper));
+ env, reinterpret_cast<intptr_t>(service),
+ bluetooth_remote_gatt_service_wrapper,
+ base::android::ConvertUTF8ToJavaString(env, instanceId).obj()));
return service;
}
@@ -123,14 +125,15 @@ void BluetoothRemoteGattServiceAndroid::CreateGattRemoteCharacteristic(
DCHECK(!characteristics_.contains(instanceIdString));
- characteristics_.set(instanceIdString,
- BluetoothRemoteGattCharacteristicAndroid::Create());
+ characteristics_.set(
+ instanceIdString,
+ BluetoothRemoteGattCharacteristicAndroid::Create(instanceIdString));
}
BluetoothRemoteGattServiceAndroid::BluetoothRemoteGattServiceAndroid(
BluetoothAdapterAndroid* adapter,
BluetoothDeviceAndroid* device,
- std::string instanceId)
+ const std::string& instanceId)
: adapter_(adapter), device_(device), instanceId_(instanceId) {}
BluetoothRemoteGattServiceAndroid::~BluetoothRemoteGattServiceAndroid() {
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_service_android.h ('k') | device/device_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698