OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "device/bluetooth/bluetooth_remote_gatt_service_android.h" | 5 #include "device/bluetooth/bluetooth_remote_gatt_service_android.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
11 #include "device/bluetooth/bluetooth_adapter_android.h" | 11 #include "device/bluetooth/bluetooth_adapter_android.h" |
12 #include "device/bluetooth/bluetooth_device_android.h" | 12 #include "device/bluetooth/bluetooth_device_android.h" |
13 #include "device/bluetooth/bluetooth_remote_gatt_characteristic_android.h" | 13 #include "device/bluetooth/bluetooth_remote_gatt_characteristic_android.h" |
14 #include "jni/ChromeBluetoothRemoteGattService_jni.h" | 14 #include "jni/ChromeBluetoothRemoteGattService_jni.h" |
15 | 15 |
16 using base::android::AttachCurrentThread; | 16 using base::android::AttachCurrentThread; |
| 17 using base::android::JavaParamRef; |
17 | 18 |
18 namespace device { | 19 namespace device { |
19 | 20 |
20 // static | 21 // static |
21 std::unique_ptr<BluetoothRemoteGattServiceAndroid> | 22 std::unique_ptr<BluetoothRemoteGattServiceAndroid> |
22 BluetoothRemoteGattServiceAndroid::Create( | 23 BluetoothRemoteGattServiceAndroid::Create( |
23 BluetoothAdapterAndroid* adapter, | 24 BluetoothAdapterAndroid* adapter, |
24 BluetoothDeviceAndroid* device, | 25 BluetoothDeviceAndroid* device, |
25 jobject /* BluetoothGattServiceWrapper */ bluetooth_gatt_service_wrapper, | 26 jobject /* BluetoothGattServiceWrapper */ bluetooth_gatt_service_wrapper, |
26 const std::string& instance_id, | 27 const std::string& instance_id, |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 void BluetoothRemoteGattServiceAndroid::EnsureCharacteristicsCreated() const { | 182 void BluetoothRemoteGattServiceAndroid::EnsureCharacteristicsCreated() const { |
182 if (!characteristics_.empty()) | 183 if (!characteristics_.empty()) |
183 return; | 184 return; |
184 | 185 |
185 // Java call | 186 // Java call |
186 Java_ChromeBluetoothRemoteGattService_createCharacteristics( | 187 Java_ChromeBluetoothRemoteGattService_createCharacteristics( |
187 AttachCurrentThread(), j_service_.obj()); | 188 AttachCurrentThread(), j_service_.obj()); |
188 } | 189 } |
189 | 190 |
190 } // namespace device | 191 } // namespace device |
OLD | NEW |