OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.device.bluetooth; |
| 6 |
| 7 import org.chromium.base.Log; |
| 8 import org.chromium.base.annotations.CalledByNative; |
| 9 import org.chromium.base.annotations.JNINamespace; |
| 10 |
| 11 /** |
| 12 * Exposes android.bluetooth.BluetoothGattService as necessary |
| 13 * for C++ device::BluetoothRemoteGattServiceAndroid. |
| 14 * |
| 15 * Lifetime is controlled by |
| 16 * device::BluetoothRemoteGattServiceAndroid. |
| 17 */ |
| 18 @JNINamespace("device") |
| 19 final class ChromeBluetoothRemoteGattService { |
| 20 private static final String TAG = "Bluetooth"; |
| 21 |
| 22 final Wrappers.BluetoothGattServiceWrapper mService; |
| 23 |
| 24 private ChromeBluetoothRemoteGattService(Wrappers.BluetoothGattServiceWrappe
r serviceWrapper) { |
| 25 mService = serviceWrapper; |
| 26 Log.v(TAG, "ChromeBluetoothRemoteGattService created."); |
| 27 } |
| 28 |
| 29 // -------------------------------------------------------------------------
-------------------- |
| 30 // BluetoothRemoteGattServiceAndroid methods implemented in java: |
| 31 |
| 32 // Implements BluetoothRemoteGattServiceAndroid::Create. |
| 33 // 'Object' type must be used because inner class Wrappers.BluetoothGattServ
iceWrapper reference |
| 34 // is not handled by jni_generator.py JavaToJni. http://crbug.com/505554 |
| 35 @CalledByNative |
| 36 private static ChromeBluetoothRemoteGattService create(Object serviceWrapper
) { |
| 37 return new ChromeBluetoothRemoteGattService( |
| 38 (Wrappers.BluetoothGattServiceWrapper) serviceWrapper); |
| 39 } |
| 40 |
| 41 // Implements BluetoothRemoteGattServiceAndroid::GetUUID. |
| 42 @CalledByNative |
| 43 private String getUUID() { |
| 44 return mService.getUuid().toString(); |
| 45 } |
| 46 } |
OLD | NEW |