summaryrefslogtreecommitdiff
path: root/PermissionController/src/com
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-12-07 21:20:56 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-12-07 21:21:10 +0000
commit3571ed967c0e90b8bd72641afb30ccdaf016dd01 (patch)
tree1107dfd3da0b05e0823d2cce9b232a6bd710ffd3 /PermissionController/src/com
parente5acd08c75fc0a18d49c364dd582097294da901b (diff)
parent46f1d0498816f8c0a310cfcc5f725208610bf1c1 (diff)
downloadPermission-3571ed967c0e90b8bd72641afb30ccdaf016dd01.tar.gz
Make change and version bump to aml_per_341410010 for mainline module file: PermissionController/AndroidManifest.xml
Make change and version bump to aml_per_341410010 for mainline module file: apex_manifest.json Merge cherrypicks of ['googleplex-android-review.googlesource.com/25544374'] into sparse-11159762-L89400030000685157. SPARSE_CHANGE: I6c0634ee995d88caeb3ee0a3f66c69b8542c462c Change-Id: I2946389161deea1a8fd47318b95f6b282ebb07f7
Diffstat (limited to 'PermissionController/src/com')
-rw-r--r--PermissionController/src/com/android/permissioncontroller/permission/ui/model/AppPermissionViewModel.kt20
1 files changed, 17 insertions, 3 deletions
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/ui/model/AppPermissionViewModel.kt b/PermissionController/src/com/android/permissioncontroller/permission/ui/model/AppPermissionViewModel.kt
index cc29acbd7..d2142a855 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/ui/model/AppPermissionViewModel.kt
+++ b/PermissionController/src/com/android/permissioncontroller/permission/ui/model/AppPermissionViewModel.kt
@@ -255,7 +255,6 @@ class AppPermissionViewModel(
mutableMapOf<String, LightAppPermGroupLiveData>()
init {
-
addSource(appPermGroupLiveData) { appPermGroup ->
lightAppPermGroup = appPermGroup
if (permGroupName in PermissionMapping.STORAGE_SUPERGROUP_PERMISSIONS) {
@@ -398,6 +397,17 @@ class AppPermissionViewModel(
deniedState.isChecked = !group.isGranted
selectState.isChecked = isPartialStorageGrant(group)
allowedState.isChecked = group.isGranted && !isPartialStorageGrant(group)
+ if (group.foreground.isPolicyFixed || group.foreground.isSystemFixed) {
+ allowedState.isEnabled = false
+ selectState.isEnabled = false
+ deniedState.isEnabled = false
+ showAdminSupportLiveData.value = admin
+ val detailId =
+ getDetailResIdForFixedByPolicyPermissionGroup(group, admin != null)
+ if (detailId != 0) {
+ detailResIdLiveData.value = detailId to null
+ }
+ }
} else {
// Allow / Deny case
allowedState.isShown = true
@@ -656,8 +666,12 @@ class AppPermissionViewModel(
fun openPhotoPicker(fragment: Fragment) {
val appPermGroup = lightAppPermGroup ?: return
- openPhotoPickerForApp(fragment.requireActivity(), appPermGroup.packageInfo.uid,
- appPermGroup.foregroundPermNames, 0)
+ openPhotoPickerForApp(
+ fragment.requireActivity(),
+ appPermGroup.packageInfo.uid,
+ appPermGroup.foregroundPermNames,
+ 0
+ )
}
/**