Fix to hide Display over other apps permission setting for the Scone
application.

Flag: EXEMPT bugfix

Bug: 349195999
Test: manually testing that the setting is removed from Adaptive
Connectivity Services advanced settings page.

Change-Id: I3f306d24040f500c7fed4f44309e9f58f5f766be
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index adaea1b..4680936 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -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>
diff --git a/src/com/android/settings/spa/app/specialaccess/DisplayOverOtherApps.kt b/src/com/android/settings/spa/app/specialaccess/DisplayOverOtherApps.kt
index 904f0af..55e842f 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 @@
         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