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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc

Issue 1422093002: bluetooth: android: BluetoothRemoteGattCharacteristicAndroid::GetUUID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-cleanup-
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
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 5286baad3b351932001c292b3c9a42771a2cfbd2..aa854637aff65de172377d4743b8a18866633d67 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc
@@ -4,28 +4,48 @@
#include "device/bluetooth/bluetooth_remote_gatt_characteristic_android.h"
+#include "base/android/jni_android.h"
+#include "base/android/jni_string.h"
#include "base/logging.h"
+#include "jni/ChromeBluetoothRemoteGattCharacteristic_jni.h"
+
+using base::android::AttachCurrentThread;
namespace device {
// static
scoped_ptr<BluetoothRemoteGattCharacteristicAndroid>
BluetoothRemoteGattCharacteristicAndroid::Create(
- const std::string& instanceId) {
- return make_scoped_ptr<BluetoothRemoteGattCharacteristicAndroid>(
+ const std::string& instanceId,
+ jobject /* BluetoothGattCharacteristicWrapper */
+ bluetooth_gatt_characteristic_wrapper) {
+ scoped_ptr<BluetoothRemoteGattCharacteristicAndroid> characteristic(
new BluetoothRemoteGattCharacteristicAndroid(instanceId));
+
+ characteristic->j_characteristic_.Reset(
+ Java_ChromeBluetoothRemoteGattCharacteristic_create(
+ AttachCurrentThread(), bluetooth_gatt_characteristic_wrapper));
+
+ return characteristic;
}
BluetoothRemoteGattCharacteristicAndroid::
~BluetoothRemoteGattCharacteristicAndroid() {}
+// static
+bool BluetoothRemoteGattCharacteristicAndroid::RegisterJNI(JNIEnv* env) {
+ return RegisterNativesImpl(
+ env); // Generated in ChromeBluetoothRemoteGattCharacteristic_jni.h
+}
+
std::string BluetoothRemoteGattCharacteristicAndroid::GetIdentifier() const {
return instanceId_;
}
BluetoothUUID BluetoothRemoteGattCharacteristicAndroid::GetUUID() const {
- NOTIMPLEMENTED();
- return BluetoothUUID();
+ return device::BluetoothUUID(ConvertJavaStringToUTF8(
+ Java_ChromeBluetoothRemoteGattCharacteristic_getUUID(
+ AttachCurrentThread(), j_characteristic_.obj())));
}
bool BluetoothRemoteGattCharacteristicAndroid::IsLocal() const {

Powered by Google App Engine
This is Rietveld 408576698