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

Unified Diff: device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothRemoteGattCharacteristic.java

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/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothRemoteGattCharacteristic.java
diff --git a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothRemoteGattCharacteristic.java b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothRemoteGattCharacteristic.java
new file mode 100644
index 0000000000000000000000000000000000000000..fbb79620a4ca86e4ed09920939aca4aff8953b1b
--- /dev/null
+++ b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothRemoteGattCharacteristic.java
@@ -0,0 +1,47 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.device.bluetooth;
+
+import org.chromium.base.Log;
+import org.chromium.base.annotations.CalledByNative;
+import org.chromium.base.annotations.JNINamespace;
+
+/**
+ * Exposes android.bluetooth.BluetoothGattCharacteristic as necessary
+ * for C++ device::BluetoothRemoteGattCharacteristicAndroid.
+ *
+ * Lifetime is controlled by
+ * device::BluetoothRemoteGattCharacteristicAndroid.
+ */
+@JNINamespace("device")
+final class ChromeBluetoothRemoteGattCharacteristic {
+ private static final String TAG = "Bluetooth";
+
+ final Wrappers.BluetoothGattCharacteristicWrapper mCharacteristic;
+
+ private ChromeBluetoothRemoteGattCharacteristic(
+ Wrappers.BluetoothGattCharacteristicWrapper characteristicWrapper) {
+ mCharacteristic = characteristicWrapper;
+ Log.v(TAG, "ChromeBluetoothRemoteGattCharacteristic created.");
+ }
+
+ // ---------------------------------------------------------------------------------------------
+ // BluetoothRemoteGattCharacteristicAndroid methods implemented in java:
+
+ // Implements BluetoothRemoteGattCharacteristicAndroid::Create.
+ // 'Object' type must be used because inner class Wrappers.BluetoothGattCharacteristicWrapper
+ // reference is not handled by jni_generator.py JavaToJni. http://crbug.com/505554
+ @CalledByNative
+ private static ChromeBluetoothRemoteGattCharacteristic create(Object characteristicWrapper) {
+ return new ChromeBluetoothRemoteGattCharacteristic(
+ (Wrappers.BluetoothGattCharacteristicWrapper) characteristicWrapper);
+ }
+
+ // Implements BluetoothRemoteGattCharacteristicAndroid::GetUUID.
+ @CalledByNative
+ private String getUUID() {
+ return mCharacteristic.getUuid().toString();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698