Merge cherrypicks of ['googleplex-android-review.googlesource.com/28101953'] into 24Q3-release.

Change-Id: I03f2802150f8c93b2f5f807bbbe740c33edb32a0
This commit is contained in:
Android Build Coastguard Worker
2024-07-04 03:25:27 +00:00
2 changed files with 14 additions and 0 deletions

View File

@@ -1552,4 +1552,8 @@
<item>Theater</item>
<item>Flower</item>
</string-array>
<!-- Packages that will not show Display over other apps permission -->
<string-array name="display_over_apps_permission_change_exempt">
</string-array>
</resources>

View File

@@ -44,6 +44,16 @@ class DisplayOverOtherAppsListModel(context: Context) : AppOpPermissionListModel
logPermissionChange(newAllowed)
}
// TODO (b/349195999)
override fun isChangeable(record: AppOpPermissionRecord): Boolean {
if (record.app.packageName in
context.resources.getStringArray(R.array.display_over_apps_permission_change_exempt)
&& record.app.isSystemApp()) {
return false
}
return super.isChangeable(record)
}
private fun logPermissionChange(newAllowed: Boolean) {
val category = when {
newAllowed -> SettingsEnums.APP_SPECIAL_PERMISSION_APPDRAW_ALLOW