diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2022-08-11 00:54:09 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-08-11 00:54:09 +0000 |
| commit | 5d31eda995f03b08f4e11055d7cb34ede1bd0ea1 (patch) | |
| tree | 8d1925c673a0d15930f280648038b074ae6fb343 /core/java/android | |
| parent | 9ed0b1cc6e31cefd412d92e715ab8c6d0c782331 (diff) | |
| parent | f21335c469c9c009a1bb1c19cefe84705fcd3bf0 (diff) | |
Merge "Revert "DO NOT MERGE: Revert "Make CheckOp return allowed if any..."" into sc-dev
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/AppOpsManager.java | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index d932a29beca6..fc89e1395073 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -2463,8 +2463,8 @@ public class AppOpsManager { * restriction} for a certain app-op. */ private static RestrictionBypass[] sOpAllowSystemRestrictionBypass = new RestrictionBypass[] { - new RestrictionBypass(true, false), //COARSE_LOCATION - new RestrictionBypass(true, false), //FINE_LOCATION + new RestrictionBypass(true, false, false), //COARSE_LOCATION + new RestrictionBypass(true, false, false), //FINE_LOCATION null, //GPS null, //VIBRATE null, //READ_CONTACTS @@ -2473,7 +2473,7 @@ public class AppOpsManager { null, //WRITE_CALL_LOG null, //READ_CALENDAR null, //WRITE_CALENDAR - new RestrictionBypass(true, false), //WIFI_SCAN + new RestrictionBypass(false, true, false), //WIFI_SCAN null, //POST_NOTIFICATION null, //NEIGHBORING_CELLS null, //CALL_PHONE @@ -2487,10 +2487,10 @@ public class AppOpsManager { null, //READ_ICC_SMS null, //WRITE_ICC_SMS null, //WRITE_SETTINGS - new RestrictionBypass(true, false), //SYSTEM_ALERT_WINDOW + new RestrictionBypass(false, true, false), //SYSTEM_ALERT_WINDOW null, //ACCESS_NOTIFICATIONS null, //CAMERA - new RestrictionBypass(false, true), //RECORD_AUDIO + new RestrictionBypass(false, false, true), //RECORD_AUDIO null, //PLAY_AUDIO null, //READ_CLIPBOARD null, //WRITE_CLIPBOARD @@ -2508,7 +2508,7 @@ public class AppOpsManager { null, //MONITOR_HIGH_POWER_LOCATION null, //GET_USAGE_STATS null, //MUTE_MICROPHONE - new RestrictionBypass(true, false), //TOAST_WINDOW + new RestrictionBypass(false, true, false), //TOAST_WINDOW null, //PROJECT_MEDIA null, //ACTIVATE_VPN null, //WALLPAPER @@ -2540,7 +2540,7 @@ public class AppOpsManager { null, // ACCEPT_HANDOVER null, // MANAGE_IPSEC_HANDOVERS null, // START_FOREGROUND - new RestrictionBypass(true, false), // BLUETOOTH_SCAN + new RestrictionBypass(false, true, false), // BLUETOOTH_SCAN null, // USE_BIOMETRIC null, // ACTIVITY_RECOGNITION null, // SMS_FINANCIAL_TRANSACTIONS @@ -3105,6 +3105,9 @@ public class AppOpsManager { * @hide */ public static class RestrictionBypass { + /** Does the app need to be system uid to bypass the restriction */ + public boolean isSystemUid; + /** Does the app need to be privileged to bypass the restriction */ public boolean isPrivileged; @@ -3114,12 +3117,14 @@ public class AppOpsManager { */ public boolean isRecordAudioRestrictionExcept; - public RestrictionBypass(boolean isPrivileged, boolean isRecordAudioRestrictionExcept) { + public RestrictionBypass(boolean isSystemUid, boolean isPrivileged, + boolean isRecordAudioRestrictionExcept) { + this.isSystemUid = isSystemUid; this.isPrivileged = isPrivileged; this.isRecordAudioRestrictionExcept = isRecordAudioRestrictionExcept; } - public static RestrictionBypass UNRESTRICTED = new RestrictionBypass(true, true); + public static RestrictionBypass UNRESTRICTED = new RestrictionBypass(false, true, true); } /** |
