| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 adapter_ = | 66 adapter_ = |
| 67 BluetoothAdapterAndroid::Create(j_fake_bluetooth_adapter_.obj()).get(); | 67 BluetoothAdapterAndroid::Create(j_fake_bluetooth_adapter_.obj()).get(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 bool BluetoothTestAndroid::DenyPermission() { | 70 bool BluetoothTestAndroid::DenyPermission() { |
| 71 Java_FakeBluetoothAdapter_denyPermission(AttachCurrentThread(), | 71 Java_FakeBluetoothAdapter_denyPermission(AttachCurrentThread(), |
| 72 j_fake_bluetooth_adapter_.obj()); | 72 j_fake_bluetooth_adapter_.obj()); |
| 73 return true; | 73 return true; |
| 74 } | 74 } |
| 75 | 75 |
| 76 void BluetoothTestAndroid::TurnOffLocationServices() { |
| 77 Java_FakeBluetoothAdapter_turnOffLocationServices( |
| 78 AttachCurrentThread(), j_fake_bluetooth_adapter_.obj()); |
| 79 } |
| 80 |
| 76 BluetoothDevice* BluetoothTestAndroid::SimulateLowEnergyDevice( | 81 BluetoothDevice* BluetoothTestAndroid::SimulateLowEnergyDevice( |
| 77 int device_ordinal) { | 82 int device_ordinal) { |
| 78 TestBluetoothAdapterObserver observer(adapter_); | 83 TestBluetoothAdapterObserver observer(adapter_); |
| 79 Java_FakeBluetoothAdapter_simulateLowEnergyDevice( | 84 Java_FakeBluetoothAdapter_simulateLowEnergyDevice( |
| 80 AttachCurrentThread(), j_fake_bluetooth_adapter_.obj(), device_ordinal); | 85 AttachCurrentThread(), j_fake_bluetooth_adapter_.obj(), device_ordinal); |
| 81 return observer.last_device(); | 86 return observer.last_device(); |
| 82 } | 87 } |
| 83 | 88 |
| 84 void BluetoothTestAndroid::ForceIllegalStateException() { | 89 void BluetoothTestAndroid::ForceIllegalStateException() { |
| 85 Java_FakeBluetoothAdapter_forceIllegalStateException( | 90 Java_FakeBluetoothAdapter_forceIllegalStateException( |
| (...skipping 382 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 |