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

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

Issue 2032273002: 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@lkcr
Patch Set: Sync Created 4 years, 6 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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