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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java

Issue 2038753004: Add a LocationUtils class to give all Chromium Android code access to location helpers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Adjust DEPS. 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: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java
index c28da2d48c38181833c13acf0f0ec66aefbfde4a..eb672dd9cdfb42e33ac4a6ef171502f18cb43458 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java
@@ -12,6 +12,7 @@ import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.metrics.RecordUserAction;
+import org.chromium.components.location.LocationUtils;
import org.json.JSONArray;
import org.json.JSONException;
@@ -226,10 +227,11 @@ public class PhysicalWebUma {
* - The Physical Web preference status
*/
public static void recordPhysicalWebState(Context context, String actionName) {
+ LocationUtils locationUtils = LocationUtils.getInstance();
handleEnum(context, createStateString(LOCATION_SERVICES, actionName),
- Utils.isLocationServicesEnabled(context) ? 1 : 0, BOOLEAN_BOUNDARY);
+ locationUtils.isSystemLocationSettingEnabled(context) ? 1 : 0, BOOLEAN_BOUNDARY);
handleEnum(context, createStateString(LOCATION_PERMISSION, actionName),
- Utils.isLocationPermissionGranted(context) ? 1 : 0, BOOLEAN_BOUNDARY);
+ locationUtils.hasAndroidLocationPermission(context) ? 1 : 0, BOOLEAN_BOUNDARY);
handleEnum(context, createStateString(BLUETOOTH, actionName),
Utils.getBluetoothEnabledStatus(context), TRISTATE_BOUNDARY);
handleEnum(context, createStateString(DATA_CONNECTION, actionName),

Powered by Google App Engine
This is Rietveld 408576698