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

Unified Diff: device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java

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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java
diff --git a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java
index a03283f36af0444a783e4ceee4c6f3631bad5368..64510c14514e1c0468626034734dfa3354ddcd68 100644
--- a/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java
+++ b/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java
@@ -185,12 +185,15 @@ final class ChromeBluetoothAdapter extends BroadcastReceiver {
// Implementation details:
/**
- * @return true if Chromium has permission to scan for Bluetooth devices.
+ * @return true if Chromium has permission to scan for Bluetooth devices and location services
+ * are on.
*/
private boolean canScan() {
Wrappers.ContextWrapper context = mAdapter.getContext();
+ boolean havePermission = context.hasAndroidLocationPermission();
+ boolean locationServicesOn = context.isSystemLocationSettingEnabled();
- return context.hasAndroidLocationPermission();
+ return havePermission && locationServicesOn;
}
private void registerBroadcastReceiver() {

Powered by Google App Engine
This is Rietveld 408576698