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

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

Issue 2261883002: Use BasicNativePage in PhysicalWebDiagnostics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/Utils.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/Utils.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/Utils.java
index c1f90655bbc31164bf119db1e83e6b9883c63094..4680e1958e9a5b0f3877157d54e3e03207b1b2a1 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/Utils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/Utils.java
@@ -11,6 +11,8 @@ import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.support.v4.content.PermissionChecker;
+import org.chromium.base.ContextUtils;
+
/**
* This class provides basic static utilities for the Physical Web.
@@ -20,21 +22,22 @@ class Utils {
public static final int RESULT_SUCCESS = 1;
public static final int RESULT_INDETERMINATE = 2;
- public static boolean isDataConnectionActive(Context context) {
- ConnectivityManager cm =
- (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
+ public static boolean isDataConnectionActive() {
+ ConnectivityManager cm = (ConnectivityManager) ContextUtils.getApplicationContext()
+ .getSystemService(Context.CONNECTIVITY_SERVICE);
return (cm.getActiveNetworkInfo() != null
&& cm.getActiveNetworkInfo().isConnectedOrConnecting());
}
- public static boolean isBluetoothPermissionGranted(Context context) {
- return PermissionChecker.checkSelfPermission(context, Manifest.permission.BLUETOOTH)
+ public static boolean isBluetoothPermissionGranted() {
+ return PermissionChecker.checkSelfPermission(
+ ContextUtils.getApplicationContext(), Manifest.permission.BLUETOOTH)
== PackageManager.PERMISSION_GRANTED;
}
- public static int getBluetoothEnabledStatus(Context context) {
+ public static int getBluetoothEnabledStatus() {
int statusResult = RESULT_INDETERMINATE;
- if (isBluetoothPermissionGranted(context)) {
+ if (isBluetoothPermissionGranted()) {
BluetoothAdapter bt = BluetoothAdapter.getDefaultAdapter();
statusResult = (bt != null && bt.isEnabled()) ? RESULT_SUCCESS : RESULT_FAILURE;
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698