summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-12-12 22:23:42 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-12-12 22:23:42 +0000
commit05bc7cc4a1e20d5e4fcb4d2c685910577007851c (patch)
tree4c8bdf9e51b38932924972acf3a80dbfe0df6c96
parent9a1499fb239293c6c18c16a09263ecb4d2665fc6 (diff)
parent2a31fd75a0090c0a7a7eb0df27664f2d9758a3e8 (diff)
Merge "Add Slog.wtf for calling setMode() with OP_COARSE_LOCATION."
-rw-r--r--services/core/java/com/android/server/appop/AppOpsService.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java
index 366766e2e47b..14f96540bc6a 100644
--- a/services/core/java/com/android/server/appop/AppOpsService.java
+++ b/services/core/java/com/android/server/appop/AppOpsService.java
@@ -20,6 +20,7 @@ import static android.app.ActivityManager.PROCESS_CAPABILITY_FOREGROUND_LOCATION
import static android.app.AppOpsManager.MAX_PRIORITY_UID_STATE;
import static android.app.AppOpsManager.MIN_PRIORITY_UID_STATE;
import static android.app.AppOpsManager.OP_CAMERA;
+import static android.app.AppOpsManager.OP_COARSE_LOCATION;
import static android.app.AppOpsManager.OP_FLAGS_ALL;
import static android.app.AppOpsManager.OP_NONE;
import static android.app.AppOpsManager.OP_PLAY_AUDIO;
@@ -1642,6 +1643,13 @@ public class AppOpsService extends IAppOpsService.Stub {
return;
}
+ // STOPSHIP: Remove this check once we are sure no one is doing it.
+ if (code == OP_COARSE_LOCATION && mode != AppOpsManager.opToDefaultMode(code)) {
+ Slog.wtf(TAG, "Trying to setMode() instead of setUidMode(), " + "code=" + code
+ + ", uid=" + uid + ", packageName=" + packageName + ", mode=" + mode
+ + ", callingUid=" + Binder.getCallingUid(), new RuntimeException());
+ }
+
synchronized (this) {
UidState uidState = getUidStateLocked(uid, false);
Op op = getOpLocked(code, uid, packageName, isPrivileged, true);