summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Severson <evanseverson@google.com>2022-10-13 17:30:15 -0700
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-12-08 04:06:00 +0000
commit596c5aa46589f62d90df04a3852e8b4be8e87dda (patch)
tree62810aba4be3bcf4f5a8680ebbc624f2b28ba78c
parent4f57a7669d6c97d310211a1827d4412fa600c999 (diff)
downloadPermission-596c5aa46589f62d90df04a3852e8b4be8e87dda.tar.gz
Add one-time flag to permission if group is currently one-time
There is currently an issue where apps can get permission-B granted permanently if the user has granted permission-A in same the group as one-time. The app can then further use that permanent grant on permission-B to get the permission-A permanently granted without user interaction. This change marks permission-B as one-time if permission-A in the group is currently granted as one-time; this will cause the permission to be revoked with the other permission. An alternative would be to prompt the user for permission-B, but this isn't consistent since 1. Permission prompts are presented as groups, so it will look like repeated UI 2. Might be considered a behavior change. Test: Manual Bug: 237405974 Change-Id: I421d28a491ff5506d0bbd1118ea915e8a6753903 Merged-In: I421d28a491ff5506d0bbd1118ea915e8a6753903 (cherry picked from commit d72688263a1924f859689b789732b608ef1d35f8) Merged-In: I421d28a491ff5506d0bbd1118ea915e8a6753903
-rw-r--r--PermissionController/src/com/android/permissioncontroller/permission/ui/model/GrantPermissionsViewModel.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/ui/model/GrantPermissionsViewModel.kt b/PermissionController/src/com/android/permissioncontroller/permission/ui/model/GrantPermissionsViewModel.kt
index 23cce17ad..93f0f74a4 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/ui/model/GrantPermissionsViewModel.kt
+++ b/PermissionController/src/com/android/permissioncontroller/permission/ui/model/GrantPermissionsViewModel.kt
@@ -674,7 +674,7 @@ class GrantPermissionsViewModel(
if (isBackground) {
KotlinUtils.grantBackgroundRuntimePermissions(app, group, listOf(perm))
} else {
- KotlinUtils.grantForegroundRuntimePermissions(app, group, listOf(perm))
+ KotlinUtils.grantForegroundRuntimePermissions(app, group, listOf(perm), group.isOneTime)
}
KotlinUtils.setGroupFlags(app, group, FLAG_PERMISSION_USER_SET to false,
FLAG_PERMISSION_USER_FIXED to false, filterPermissions = listOf(perm))