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

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

Issue 2105573002: Revert of 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: 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
« no previous file with comments | « device/bluetooth/android/java/src/org/chromium/device/bluetooth/Wrappers.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java
diff --git a/device/bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java b/device/bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java
index ae1873581adce554331f4e26fee34bd6a2b9e362..35d2dbcaf67247147ba9b0ac1642c6962269b0c7 100644
--- a/device/bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java
+++ b/device/bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java
@@ -4,6 +4,7 @@
package org.chromium.device.bluetooth;
+import android.Manifest;
import android.annotation.TargetApi;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.le.ScanFilter;
@@ -22,7 +23,9 @@
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import java.util.UUID;
/**
@@ -65,7 +68,7 @@
@CalledByNative("FakeBluetoothAdapter")
public void denyPermission() {
- mFakeContext.mHasLocation = false;
+ mFakeContext.mPermissions.clear();
}
/**
@@ -191,15 +194,16 @@
* Fakes android.content.Context.
*/
static class FakeContext extends Wrappers.ContextWrapper {
- public boolean mHasLocation = true;
+ public final Set<String> mPermissions = new HashSet<String>();
public FakeContext() {
super(null);
- }
-
- @Override
- public boolean hasAndroidLocationPermission() {
- return mHasLocation;
+ mPermissions.add(Manifest.permission.ACCESS_COARSE_LOCATION);
+ }
+
+ @Override
+ public boolean checkPermission(String permission) {
+ return mPermissions.contains(permission);
}
@Override
« no previous file with comments | « device/bluetooth/android/java/src/org/chromium/device/bluetooth/Wrappers.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698