| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 134 } |
| 135 | 135 |
| 136 void BluetoothAdapterAndroid::CreateOrUpdateDeviceOnScan( | 136 void BluetoothAdapterAndroid::CreateOrUpdateDeviceOnScan( |
| 137 JNIEnv* env, | 137 JNIEnv* env, |
| 138 jobject caller, | 138 jobject caller, |
| 139 const jstring& address, | 139 const jstring& address, |
| 140 jobject bluetooth_device_wrapper, // Java Type: bluetoothDeviceWrapper | 140 jobject bluetooth_device_wrapper, // Java Type: bluetoothDeviceWrapper |
| 141 jobject advertised_uuids) { // Java Type: List<ParcelUuid> | 141 jobject advertised_uuids) { // Java Type: List<ParcelUuid> |
| 142 BluetoothDevice*& device = devices_[ConvertJavaStringToUTF8(env, address)]; | 142 BluetoothDevice*& device = devices_[ConvertJavaStringToUTF8(env, address)]; |
| 143 if (!device) { | 143 if (!device) { |
| 144 device = BluetoothDeviceAndroid::Create(bluetooth_device_wrapper); | 144 device = BluetoothDeviceAndroid::Create(this, bluetooth_device_wrapper); |
| 145 static_cast<BluetoothDeviceAndroid*>(device) | 145 static_cast<BluetoothDeviceAndroid*>(device) |
| 146 ->UpdateAdvertisedUUIDs(advertised_uuids); | 146 ->UpdateAdvertisedUUIDs(advertised_uuids); |
| 147 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, | 147 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
| 148 DeviceAdded(this, device)); | 148 DeviceAdded(this, device)); |
| 149 } else { | 149 } else { |
| 150 if (static_cast<BluetoothDeviceAndroid*>(device) | 150 if (static_cast<BluetoothDeviceAndroid*>(device) |
| 151 ->UpdateAdvertisedUUIDs(advertised_uuids)) { | 151 ->UpdateAdvertisedUUIDs(advertised_uuids)) { |
| 152 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, | 152 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
| 153 DeviceChanged(this, device)); | 153 DeviceChanged(this, device)); |
| 154 } | 154 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 // TODO(scheib): Support filters crbug.com/490401 | 197 // TODO(scheib): Support filters crbug.com/490401 |
| 198 NOTIMPLEMENTED(); | 198 NOTIMPLEMENTED(); |
| 199 error_callback.Run(UMABluetoothDiscoverySessionOutcome::NOT_IMPLEMENTED); | 199 error_callback.Run(UMABluetoothDiscoverySessionOutcome::NOT_IMPLEMENTED); |
| 200 } | 200 } |
| 201 | 201 |
| 202 void BluetoothAdapterAndroid::RemovePairingDelegateInternal( | 202 void BluetoothAdapterAndroid::RemovePairingDelegateInternal( |
| 203 device::BluetoothDevice::PairingDelegate* pairing_delegate) { | 203 device::BluetoothDevice::PairingDelegate* pairing_delegate) { |
| 204 } | 204 } |
| 205 | 205 |
| 206 } // namespace device | 206 } // namespace device |
| OLD | NEW |