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