From 74670e4923d940f8777c5e085c8a1613cadf03bf Mon Sep 17 00:00:00 2001 From: Steve Statia Date: Thu, 27 Jun 2024 00:22:07 +0000 Subject: [PATCH] Fix to hide Display over other apps permission setting for the Scone application. Bug: 349195999 Test: manually testing that the setting is removed from Adaptive Connectivity Services advanced settings page. Change-Id: I3f306d24040f500c7fed4f44309e9f58f5f766be Merged-In: I3f306d24040f500c7fed4f44309e9f58f5f766be --- res/values/arrays.xml | 4 ++++ .../spa/app/specialaccess/DisplayOverOtherApps.kt | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/res/values/arrays.xml b/res/values/arrays.xml index 0e35fed6a11..d5ba3d781ab 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -1517,4 +1517,8 @@ 2 + + + + diff --git a/src/com/android/settings/spa/app/specialaccess/DisplayOverOtherApps.kt b/src/com/android/settings/spa/app/specialaccess/DisplayOverOtherApps.kt index 904f0afd3d6..58695f700eb 100644 --- a/src/com/android/settings/spa/app/specialaccess/DisplayOverOtherApps.kt +++ b/src/com/android/settings/spa/app/specialaccess/DisplayOverOtherApps.kt @@ -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