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_adapter_android.h" | 5 #include "device/bluetooth/bluetooth_adapter_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/sequenced_task_runner.h" | 9 #include "base/sequenced_task_runner.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 133 } |
134 | 134 |
135 void BluetoothAdapterAndroid::CreateOrUpdateDeviceOnScan( | 135 void BluetoothAdapterAndroid::CreateOrUpdateDeviceOnScan( |
136 JNIEnv* env, | 136 JNIEnv* env, |
137 jobject caller, | 137 jobject caller, |
138 const jstring& address, | 138 const jstring& address, |
139 jobject bluetooth_device_wrapper, // Java Type: bluetoothDeviceWrapper | 139 jobject bluetooth_device_wrapper, // Java Type: bluetoothDeviceWrapper |
140 jobject advertised_uuids) { // Java Type: List<ParcelUuid> | 140 jobject advertised_uuids) { // Java Type: List<ParcelUuid> |
141 BluetoothDevice*& device = devices_[ConvertJavaStringToUTF8(env, address)]; | 141 BluetoothDevice*& device = devices_[ConvertJavaStringToUTF8(env, address)]; |
142 if (!device) { | 142 if (!device) { |
143 device = BluetoothDeviceAndroid::Create(bluetooth_device_wrapper); | 143 device = BluetoothDeviceAndroid::Create(this, bluetooth_device_wrapper); |
144 static_cast<BluetoothDeviceAndroid*>(device) | 144 static_cast<BluetoothDeviceAndroid*>(device) |
145 ->UpdateAdvertisedUUIDs(advertised_uuids); | 145 ->UpdateAdvertisedUUIDs(advertised_uuids); |
146 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, | 146 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
147 DeviceAdded(this, device)); | 147 DeviceAdded(this, device)); |
148 } else { | 148 } else { |
149 if (static_cast<BluetoothDeviceAndroid*>(device) | 149 if (static_cast<BluetoothDeviceAndroid*>(device) |
150 ->UpdateAdvertisedUUIDs(advertised_uuids)) { | 150 ->UpdateAdvertisedUUIDs(advertised_uuids)) { |
151 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, | 151 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
152 DeviceChanged(this, device)); | 152 DeviceChanged(this, device)); |
153 } | 153 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // TODO(scheib): Support filters crbug.com/490401 | 194 // TODO(scheib): Support filters crbug.com/490401 |
195 NOTIMPLEMENTED(); | 195 NOTIMPLEMENTED(); |
196 error_callback.Run(); | 196 error_callback.Run(); |
197 } | 197 } |
198 | 198 |
199 void BluetoothAdapterAndroid::RemovePairingDelegateInternal( | 199 void BluetoothAdapterAndroid::RemovePairingDelegateInternal( |
200 device::BluetoothDevice::PairingDelegate* pairing_delegate) { | 200 device::BluetoothDevice::PairingDelegate* pairing_delegate) { |
201 } | 201 } |
202 | 202 |
203 } // namespace device | 203 } // namespace device |
OLD | NEW |