| 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/test/bluetooth_test_android.h" | 5 #include "device/bluetooth/test/bluetooth_test_android.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } | 74 } |
| 75 | 75 |
| 76 BluetoothDevice* BluetoothTestAndroid::SimulateLowEnergyDevice( | 76 BluetoothDevice* BluetoothTestAndroid::SimulateLowEnergyDevice( |
| 77 int device_ordinal) { | 77 int device_ordinal) { |
| 78 TestBluetoothAdapterObserver observer(adapter_); | 78 TestBluetoothAdapterObserver observer(adapter_); |
| 79 Java_FakeBluetoothAdapter_simulateLowEnergyDevice( | 79 Java_FakeBluetoothAdapter_simulateLowEnergyDevice( |
| 80 AttachCurrentThread(), j_fake_bluetooth_adapter_.obj(), device_ordinal); | 80 AttachCurrentThread(), j_fake_bluetooth_adapter_.obj(), device_ordinal); |
| 81 return observer.last_device(); | 81 return observer.last_device(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void BluetoothTestAndroid::SimulateLocationServicesOff() { |
| 85 Java_FakeBluetoothAdapter_simulateLocationServicesOff( |
| 86 AttachCurrentThread(), j_fake_bluetooth_adapter_.obj()); |
| 87 } |
| 88 |
| 84 void BluetoothTestAndroid::ForceIllegalStateException() { | 89 void BluetoothTestAndroid::ForceIllegalStateException() { |
| 85 Java_FakeBluetoothAdapter_forceIllegalStateException( | 90 Java_FakeBluetoothAdapter_forceIllegalStateException( |
| 86 AttachCurrentThread(), j_fake_bluetooth_adapter_.obj()); | 91 AttachCurrentThread(), j_fake_bluetooth_adapter_.obj()); |
| 87 } | 92 } |
| 88 | 93 |
| 89 void BluetoothTestAndroid::SimulateGattConnection(BluetoothDevice* device) { | 94 void BluetoothTestAndroid::SimulateGattConnection(BluetoothDevice* device) { |
| 90 BluetoothDeviceAndroid* device_android = | 95 BluetoothDeviceAndroid* device_android = |
| 91 static_cast<BluetoothDeviceAndroid*>(device); | 96 static_cast<BluetoothDeviceAndroid*>(device); |
| 92 | 97 |
| 93 Java_FakeBluetoothDevice_connectionStateChange( | 98 Java_FakeBluetoothDevice_connectionStateChange( |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 } | 473 } |
| 469 | 474 |
| 470 void BluetoothTestAndroid::OnFakeAdapterStateChanged( | 475 void BluetoothTestAndroid::OnFakeAdapterStateChanged( |
| 471 JNIEnv* env, | 476 JNIEnv* env, |
| 472 const JavaParamRef<jobject>& caller, | 477 const JavaParamRef<jobject>& caller, |
| 473 const bool powered) { | 478 const bool powered) { |
| 474 adapter_->NotifyAdapterPoweredChanged(powered); | 479 adapter_->NotifyAdapterPoweredChanged(powered); |
| 475 } | 480 } |
| 476 | 481 |
| 477 } // namespace device | 482 } // namespace device |
| OLD | NEW |