| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_ANDROID_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_ANDROID_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_ANDROID_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_ANDROID_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // discovered. | 103 // discovered. |
| 104 void OnGattServicesDiscovered( | 104 void OnGattServicesDiscovered( |
| 105 JNIEnv* env, | 105 JNIEnv* env, |
| 106 const base::android::JavaParamRef<jobject>& jcaller); | 106 const base::android::JavaParamRef<jobject>& jcaller); |
| 107 | 107 |
| 108 // Creates Bluetooth GATT service objects and adds them to | 108 // Creates Bluetooth GATT service objects and adds them to |
| 109 // BluetoothDevice::gatt_services_ if they are not already there. | 109 // BluetoothDevice::gatt_services_ if they are not already there. |
| 110 void CreateGattRemoteService( | 110 void CreateGattRemoteService( |
| 111 JNIEnv* env, | 111 JNIEnv* env, |
| 112 const base::android::JavaParamRef<jobject>& caller, | 112 const base::android::JavaParamRef<jobject>& caller, |
| 113 const base::android::JavaParamRef<jstring>& instanceId, | 113 const base::android::JavaParamRef<jstring>& instance_id, |
| 114 const base::android::JavaParamRef<jobject>& | 114 const base::android::JavaParamRef<jobject>& |
| 115 bluetooth_gatt_service_wrapper); // BluetoothGattServiceWrapper | 115 bluetooth_gatt_service_wrapper); // BluetoothGattServiceWrapper |
| 116 | 116 |
| 117 protected: | 117 protected: |
| 118 BluetoothDeviceAndroid(BluetoothAdapterAndroid* adapter); | 118 BluetoothDeviceAndroid(BluetoothAdapterAndroid* adapter); |
| 119 | 119 |
| 120 // BluetoothDevice: | 120 // BluetoothDevice: |
| 121 std::string GetDeviceName() const override; | 121 std::string GetDeviceName() const override; |
| 122 void CreateGattConnectionImpl() override; | 122 void CreateGattConnectionImpl() override; |
| 123 void DisconnectGatt() override; | 123 void DisconnectGatt() override; |
| 124 | 124 |
| 125 // Java object org.chromium.device.bluetooth.ChromeBluetoothDevice. | 125 // Java object org.chromium.device.bluetooth.ChromeBluetoothDevice. |
| 126 base::android::ScopedJavaGlobalRef<jobject> j_device_; | 126 base::android::ScopedJavaGlobalRef<jobject> j_device_; |
| 127 | 127 |
| 128 bool gatt_connected_ = false; | 128 bool gatt_connected_ = false; |
| 129 | 129 |
| 130 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceAndroid); | 130 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceAndroid); |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 } // namespace device | 133 } // namespace device |
| 134 | 134 |
| 135 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_ANDROID_H_ | 135 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_ANDROID_H_ |
| OLD | NEW |