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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_service_android.cc

Issue 1395783005: bluetooth: android: BluetoothRemoteGattServiceAndroid::GetUUID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed jyasskin comments 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
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 aa25fec4614d0c211c9cf95eb1ab21f2a9d25a80..c9caa3a3ab1f23cab6075508214f1d909e7a498f 100644
--- a/device/bluetooth/bluetooth_remote_gatt_service_android.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_service_android.cc
@@ -4,8 +4,13 @@
#include "device/bluetooth/bluetooth_remote_gatt_service_android.h"
+#include "base/android/jni_android.h"
+#include "base/android/jni_string.h"
#include "device/bluetooth/bluetooth_adapter_android.h"
#include "device/bluetooth/bluetooth_device_android.h"
+#include "jni/ChromeBluetoothRemoteGattService_jni.h"
+
+using base::android::AttachCurrentThread;
namespace device {
@@ -18,16 +23,26 @@ BluetoothRemoteGattServiceAndroid* BluetoothRemoteGattServiceAndroid::Create(
BluetoothRemoteGattServiceAndroid* service =
new BluetoothRemoteGattServiceAndroid(adapter, device, instanceId);
+ service->j_service_.Reset(Java_ChromeBluetoothRemoteGattService_create(
+ AttachCurrentThread(), bluetooth_remote_gatt_service_wrapper));
+
return service;
}
+// static
+bool BluetoothRemoteGattServiceAndroid::RegisterJNI(JNIEnv* env) {
+ return RegisterNativesImpl(
+ env); // Generated in ChromeBluetoothRemoteGattService_jni.h
+}
+
std::string BluetoothRemoteGattServiceAndroid::GetIdentifier() const {
return instanceId_;
}
device::BluetoothUUID BluetoothRemoteGattServiceAndroid::GetUUID() const {
- NOTIMPLEMENTED();
- return device::BluetoothUUID();
+ return device::BluetoothUUID(
+ ConvertJavaStringToUTF8(Java_ChromeBluetoothRemoteGattService_getUUID(
+ AttachCurrentThread(), j_service_.obj())));
}
bool BluetoothRemoteGattServiceAndroid::IsLocal() const {

Powered by Google App Engine
This is Rietveld 408576698