Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: device/bluetooth/test/bluetooth_test_android.cc

Issue 2102813002: If location services are turned off, have the BT chooser prompt the user to turn them on. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-fix-testing
Patch Set: Address tedchoc's comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/bluetooth/test/bluetooth_test_android.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 79
80 BluetoothDevice* BluetoothTestAndroid::SimulateLowEnergyDevice( 80 BluetoothDevice* BluetoothTestAndroid::SimulateLowEnergyDevice(
81 int device_ordinal) { 81 int device_ordinal) {
82 TestBluetoothAdapterObserver observer(adapter_); 82 TestBluetoothAdapterObserver observer(adapter_);
83 Java_FakeBluetoothAdapter_simulateLowEnergyDevice( 83 Java_FakeBluetoothAdapter_simulateLowEnergyDevice(
84 AttachCurrentThread(), j_fake_bluetooth_adapter_.obj(), device_ordinal); 84 AttachCurrentThread(), j_fake_bluetooth_adapter_.obj(), device_ordinal);
85 return observer.last_device(); 85 return observer.last_device();
86 } 86 }
87 87
88 void BluetoothTestAndroid::SimulateLocationServicesOff() {
89 Java_Fakes_setLocationServicesState(
90 AttachCurrentThread(), true /* hasPermission */, false /* isEnabled */);
91 }
92
88 void BluetoothTestAndroid::ForceIllegalStateException() { 93 void BluetoothTestAndroid::ForceIllegalStateException() {
89 Java_FakeBluetoothAdapter_forceIllegalStateException( 94 Java_FakeBluetoothAdapter_forceIllegalStateException(
90 AttachCurrentThread(), j_fake_bluetooth_adapter_.obj()); 95 AttachCurrentThread(), j_fake_bluetooth_adapter_.obj());
91 } 96 }
92 97
93 void BluetoothTestAndroid::SimulateGattConnection(BluetoothDevice* device) { 98 void BluetoothTestAndroid::SimulateGattConnection(BluetoothDevice* device) {
94 BluetoothDeviceAndroid* device_android = 99 BluetoothDeviceAndroid* device_android =
95 static_cast<BluetoothDeviceAndroid*>(device); 100 static_cast<BluetoothDeviceAndroid*>(device);
96 101
97 Java_FakeBluetoothDevice_connectionStateChange( 102 Java_FakeBluetoothDevice_connectionStateChange(
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 } 477 }
473 478
474 void BluetoothTestAndroid::OnFakeAdapterStateChanged( 479 void BluetoothTestAndroid::OnFakeAdapterStateChanged(
475 JNIEnv* env, 480 JNIEnv* env,
476 const JavaParamRef<jobject>& caller, 481 const JavaParamRef<jobject>& caller,
477 const bool powered) { 482 const bool powered) {
478 adapter_->NotifyAdapterPoweredChanged(powered); 483 adapter_->NotifyAdapterPoweredChanged(powered);
479 } 484 }
480 485
481 } // namespace device 486 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/test/bluetooth_test_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698