| 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 "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 const CreateServiceErrorCallback& error_callback) override; | 75 const CreateServiceErrorCallback& error_callback) override; |
| 76 void RegisterAudioSink( | 76 void RegisterAudioSink( |
| 77 const BluetoothAudioSink::Options& options, | 77 const BluetoothAudioSink::Options& options, |
| 78 const AcquiredCallback& callback, | 78 const AcquiredCallback& callback, |
| 79 const BluetoothAudioSink::ErrorCallback& error_callback) override; | 79 const BluetoothAudioSink::ErrorCallback& error_callback) override; |
| 80 void RegisterAdvertisement( | 80 void RegisterAdvertisement( |
| 81 scoped_ptr<BluetoothAdvertisement::Data> advertisement_data, | 81 scoped_ptr<BluetoothAdvertisement::Data> advertisement_data, |
| 82 const CreateAdvertisementCallback& callback, | 82 const CreateAdvertisementCallback& callback, |
| 83 const CreateAdvertisementErrorCallback& error_callback) override; | 83 const CreateAdvertisementErrorCallback& error_callback) override; |
| 84 | 84 |
| 85 // Returns BluetoothAdapter Observers for use by Android platform |
| 86 // implementation classes to send event notifications. Intentionally not |
| 87 // exposed on the public base class BluetoothAdapter as it is an |
| 88 // implementation detail. |
| 89 base::ObserverList<device::BluetoothAdapter::Observer>& GetObservers() { |
| 90 return observers_; |
| 91 } |
| 92 |
| 85 // Handles a scan error event by invalidating all discovery sessions. | 93 // Handles a scan error event by invalidating all discovery sessions. |
| 86 void OnScanFailed(JNIEnv* env, jobject caller); | 94 void OnScanFailed(JNIEnv* env, jobject caller); |
| 87 | 95 |
| 88 // Creates or updates device with advertised UUID information when a device is | 96 // Creates or updates device with advertised UUID information when a device is |
| 89 // discovered during a scan. | 97 // discovered during a scan. |
| 90 void CreateOrUpdateDeviceOnScan( | 98 void CreateOrUpdateDeviceOnScan( |
| 91 JNIEnv* env, | 99 JNIEnv* env, |
| 92 jobject caller, | 100 jobject caller, |
| 93 const jstring& address, | 101 const jstring& address, |
| 94 jobject bluetooth_device_wrapper, // Java Type: bluetoothDeviceWrapper | 102 jobject bluetooth_device_wrapper, // Java Type: bluetoothDeviceWrapper |
| (...skipping 25 matching lines...) Expand all Loading... |
| 120 // Note: This should remain the last member so it'll be destroyed and | 128 // Note: This should remain the last member so it'll be destroyed and |
| 121 // invalidate its weak pointers before any other members are destroyed. | 129 // invalidate its weak pointers before any other members are destroyed. |
| 122 base::WeakPtrFactory<BluetoothAdapterAndroid> weak_ptr_factory_; | 130 base::WeakPtrFactory<BluetoothAdapterAndroid> weak_ptr_factory_; |
| 123 | 131 |
| 124 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterAndroid); | 132 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterAndroid); |
| 125 }; | 133 }; |
| 126 | 134 |
| 127 } // namespace device | 135 } // namespace device |
| 128 | 136 |
| 129 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ | 137 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_ANDROID_H_ |
| OLD | NEW |