| 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 "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "device/bluetooth/bluetooth_adapter_android.h" | 10 #include "device/bluetooth/bluetooth_adapter_android.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void OnConnectionStateChange(JNIEnv* env, | 92 void OnConnectionStateChange(JNIEnv* env, |
| 93 jobject jcaller, | 93 jobject jcaller, |
| 94 int32_t status, | 94 int32_t status, |
| 95 bool connected); | 95 bool connected); |
| 96 | 96 |
| 97 // Creates Bluetooth GATT service objects and adds them to | 97 // Creates Bluetooth GATT service objects and adds them to |
| 98 // BluetoothDevice::gatt_services_ if they are not already there. | 98 // BluetoothDevice::gatt_services_ if they are not already there. |
| 99 void CreateGattRemoteService( | 99 void CreateGattRemoteService( |
| 100 JNIEnv* env, | 100 JNIEnv* env, |
| 101 jobject caller, | 101 jobject caller, |
| 102 int32_t instanceId, | 102 const jstring& instanceId, |
| 103 jobject bluetooth_gatt_service_wrapper); // Java Type: | 103 jobject bluetooth_gatt_service_wrapper); // Java Type: |
| 104 // BluetoothGattServiceWrapper | 104 // BluetoothGattServiceWrapper |
| 105 | 105 |
| 106 protected: | 106 protected: |
| 107 BluetoothDeviceAndroid(BluetoothAdapterAndroid* adapter); | 107 BluetoothDeviceAndroid(BluetoothAdapterAndroid* adapter); |
| 108 | 108 |
| 109 // BluetoothDevice: | 109 // BluetoothDevice: |
| 110 std::string GetDeviceName() const override; | 110 std::string GetDeviceName() const override; |
| 111 void CreateGattConnectionImpl() override; | 111 void CreateGattConnectionImpl() override; |
| 112 void DisconnectGatt() override; | 112 void DisconnectGatt() override; |
| 113 | 113 |
| 114 // Java object org.chromium.device.bluetooth.ChromeBluetoothDevice. | 114 // Java object org.chromium.device.bluetooth.ChromeBluetoothDevice. |
| 115 base::android::ScopedJavaGlobalRef<jobject> j_device_; | 115 base::android::ScopedJavaGlobalRef<jobject> j_device_; |
| 116 | 116 |
| 117 bool gatt_connected_ = false; | 117 bool gatt_connected_ = false; |
| 118 | 118 |
| 119 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceAndroid); | 119 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceAndroid); |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 } // namespace device | 122 } // namespace device |
| 123 | 123 |
| 124 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_ANDROID_H_ | 124 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_ANDROID_H_ |
| OLD | NEW |