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 #include "device/bluetooth/bluetooth_remote_gatt_characteristic_android.h" | 5 #include "device/bluetooth/bluetooth_remote_gatt_characteristic_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_array.h" | 10 #include "base/android/jni_array.h" |
11 #include "base/android/jni_string.h" | 11 #include "base/android/jni_string.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
16 #include "base/threading/thread_task_runner_handle.h" | 16 #include "base/threading/thread_task_runner_handle.h" |
17 #include "device/bluetooth/bluetooth_adapter_android.h" | 17 #include "device/bluetooth/bluetooth_adapter_android.h" |
18 #include "device/bluetooth/bluetooth_gatt_notify_session_android.h" | 18 #include "device/bluetooth/bluetooth_gatt_notify_session_android.h" |
19 #include "device/bluetooth/bluetooth_remote_gatt_descriptor_android.h" | 19 #include "device/bluetooth/bluetooth_remote_gatt_descriptor_android.h" |
20 #include "device/bluetooth/bluetooth_remote_gatt_service_android.h" | 20 #include "device/bluetooth/bluetooth_remote_gatt_service_android.h" |
21 #include "jni/ChromeBluetoothRemoteGattCharacteristic_jni.h" | 21 #include "jni/ChromeBluetoothRemoteGattCharacteristic_jni.h" |
22 | 22 |
23 using base::android::AttachCurrentThread; | 23 using base::android::AttachCurrentThread; |
| 24 using base::android::JavaParamRef; |
24 | 25 |
25 namespace device { | 26 namespace device { |
26 | 27 |
27 // static | 28 // static |
28 std::unique_ptr<BluetoothRemoteGattCharacteristicAndroid> | 29 std::unique_ptr<BluetoothRemoteGattCharacteristicAndroid> |
29 BluetoothRemoteGattCharacteristicAndroid::Create( | 30 BluetoothRemoteGattCharacteristicAndroid::Create( |
30 BluetoothAdapterAndroid* adapter, | 31 BluetoothAdapterAndroid* adapter, |
31 BluetoothRemoteGattServiceAndroid* service, | 32 BluetoothRemoteGattServiceAndroid* service, |
32 const std::string& instance_id, | 33 const std::string& instance_id, |
33 jobject /* BluetoothGattCharacteristicWrapper */ | 34 jobject /* BluetoothGattCharacteristicWrapper */ |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 void BluetoothRemoteGattCharacteristicAndroid::EnsureDescriptorsCreated() | 344 void BluetoothRemoteGattCharacteristicAndroid::EnsureDescriptorsCreated() |
344 const { | 345 const { |
345 if (!descriptors_.empty()) | 346 if (!descriptors_.empty()) |
346 return; | 347 return; |
347 | 348 |
348 Java_ChromeBluetoothRemoteGattCharacteristic_createDescriptors( | 349 Java_ChromeBluetoothRemoteGattCharacteristic_createDescriptors( |
349 AttachCurrentThread(), j_characteristic_.obj()); | 350 AttachCurrentThread(), j_characteristic_.obj()); |
350 } | 351 } |
351 | 352 |
352 } // namespace device | 353 } // namespace device |
OLD | NEW |