diff options
| author | 2020-08-06 13:54:37 -0700 | |
|---|---|---|
| committer | 2020-09-23 14:06:06 -0700 | |
| commit | a9b8b66e97ef66b9723c03314c8c1138cf9fe12e (patch) | |
| tree | 69c33f16f9bc8eac2a6c4be0fd789ccded5b255e | |
| parent | d7087b25ce394ec54cc6ec8e2852aee0a12c0e8a (diff) | |
Treat background mic/camera normally
Since the addition of background mic/camera, the foreground mode now
takes the mode MODE_FOREGROUND so now we don't need to treat
MODE_ALLOWED specially for microphone and camera.
Test: Try bg camera/mic access from fg/bg && with both levels of access
Bug: 158311343
Change-Id: I17b5cbfe6644bcbfc9c295487ca41482113562d9
| -rw-r--r-- | services/core/java/com/android/server/appop/AppOpsService.java | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java index 668713f0fee7..c1777b847d9b 100644 --- a/services/core/java/com/android/server/appop/AppOpsService.java +++ b/services/core/java/com/android/server/appop/AppOpsService.java @@ -584,29 +584,6 @@ public class AppOpsService extends IAppOpsService.Stub { // process is not in foreground. return MODE_IGNORED; } - } else if (mode == MODE_ALLOWED) { - switch (op) { - case OP_CAMERA: - if (mActivityManagerInternal != null - && mActivityManagerInternal.isPendingTopUid(uid)) { - return MODE_ALLOWED; - } else if ((capability & PROCESS_CAPABILITY_FOREGROUND_CAMERA) != 0) { - return MODE_ALLOWED; - } else { - return MODE_IGNORED; - } - case OP_RECORD_AUDIO: - if (mActivityManagerInternal != null - && mActivityManagerInternal.isPendingTopUid(uid)) { - return MODE_ALLOWED; - } else if ((capability & PROCESS_CAPABILITY_FOREGROUND_MICROPHONE) != 0) { - return MODE_ALLOWED; - } else { - return MODE_IGNORED; - } - default: - return MODE_ALLOWED; - } } return mode; } |