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

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

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/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothRemoteGattService.java
diff --git a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothRemoteGattService.java b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothRemoteGattService.java
new file mode 100644
index 0000000000000000000000000000000000000000..62c379ab9d95f9072078a6889ed78fcb56680916
--- /dev/null
+++ b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothRemoteGattService.java
@@ -0,0 +1,46 @@
+// 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.BluetoothGattService as necessary
+ * for C++ device::BluetoothRemoteGattServiceAndroid.
+ *
+ * Lifetime is controlled by
+ * device::BluetoothRemoteGattServiceAndroid.
+ */
+@JNINamespace("device")
+final class ChromeBluetoothRemoteGattService {
+ private static final String TAG = "Bluetooth";
+
+ final Wrappers.BluetoothGattServiceWrapper mService;
+
+ private ChromeBluetoothRemoteGattService(Wrappers.BluetoothGattServiceWrapper serviceWrapper) {
+ mService = serviceWrapper;
+ Log.v(TAG, "ChromeBluetoothRemoteGattService created.");
+ }
+
+ // ---------------------------------------------------------------------------------------------
+ // BluetoothRemoteGattServiceAndroid methods implemented in java:
+
+ // Implements BluetoothRemoteGattServiceAndroid::Create.
+ // 'Object' type must be used because inner class Wrappers.BluetoothGattServiceWrapper reference
+ // is not handled by jni_generator.py JavaToJni. http://crbug.com/505554
+ @CalledByNative
+ private static ChromeBluetoothRemoteGattService create(Object serviceWrapper) {
+ return new ChromeBluetoothRemoteGattService(
+ (Wrappers.BluetoothGattServiceWrapper) serviceWrapper);
+ }
+
+ // Implements BluetoothRemoteGattServiceAndroid::GetUUID.
+ @CalledByNative
+ private String getUUID() {
+ return mService.getUuid().toString();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698