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_ADAPTER_ANDROID_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 BluetoothDiscoveryFilter* discovery_filter, | 121 BluetoothDiscoveryFilter* discovery_filter, |
122 const base::Closure& callback, | 122 const base::Closure& callback, |
123 const DiscoverySessionErrorCallback& error_callback) override; | 123 const DiscoverySessionErrorCallback& error_callback) override; |
124 void SetDiscoveryFilter( | 124 void SetDiscoveryFilter( |
125 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter, | 125 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter, |
126 const base::Closure& callback, | 126 const base::Closure& callback, |
127 const DiscoverySessionErrorCallback& error_callback) override; | 127 const DiscoverySessionErrorCallback& error_callback) override; |
128 void RemovePairingDelegateInternal( | 128 void RemovePairingDelegateInternal( |
129 BluetoothDevice::PairingDelegate* pairing_delegate) override; | 129 BluetoothDevice::PairingDelegate* pairing_delegate) override; |
130 | 130 |
| 131 void PurgeTimedOutDevices(); |
| 132 |
| 133 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; |
| 134 |
131 // Java object org.chromium.device.bluetooth.ChromeBluetoothAdapter. | 135 // Java object org.chromium.device.bluetooth.ChromeBluetoothAdapter. |
132 base::android::ScopedJavaGlobalRef<jobject> j_adapter_; | 136 base::android::ScopedJavaGlobalRef<jobject> j_adapter_; |
133 | 137 |
| 138 private: |
| 139 bool AddDiscoverySessionInternal(); |
| 140 bool RemoveDiscoverySessionInternal(); |
| 141 |
| 142 uint8_t numDiscoverySessions = 0; |
| 143 |
134 // Note: This should remain the last member so it'll be destroyed and | 144 // Note: This should remain the last member so it'll be destroyed and |
135 // invalidate its weak pointers before any other members are destroyed. | 145 // invalidate its weak pointers before any other members are destroyed. |
136 base::WeakPtrFactory<BluetoothAdapterAndroid> weak_ptr_factory_; | 146 base::WeakPtrFactory<BluetoothAdapterAndroid> weak_ptr_factory_; |
137 | 147 |
138 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterAndroid); | 148 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterAndroid); |
139 }; | 149 }; |
140 | 150 |
141 } // namespace device | 151 } // namespace device |
142 | 152 |
143 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ | 153 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ |
OLD | NEW |