Update Special App Access Compose Components for ECM
This is the first in a series of changes to wire up all app settings to be ECM restrictable. We introduce a new method in RestrictedLockUtilsInternal which determines whether or not a setting is restricted based on a passed in key. It currently duplicates the current implementation, but will eventually be replaced by a call to permissions mainline. The settings under SpaPrivileged are then updated to have a new BlockedByEcm which is decided by the RestrictedLockUtilsInternal call. Bug: 297372999 Test: Manually tested on device. Automaated tests to follow Change-Id: Ic295bdb41270b0f18f2ba3dffdffc062d532cabe
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.settings.spa.app.specialaccess
|
|||||||
|
|
||||||
import android.Manifest
|
import android.Manifest
|
||||||
import android.app.AlarmManager
|
import android.app.AlarmManager
|
||||||
|
import android.app.AppOpsManager
|
||||||
import android.app.compat.CompatChanges
|
import android.app.compat.CompatChanges
|
||||||
import android.app.settings.SettingsEnums
|
import android.app.settings.SettingsEnums
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
@@ -56,6 +57,7 @@ class AlarmsAndRemindersAppListModel(
|
|||||||
override val pageTitleResId = R.string.alarms_and_reminders_title
|
override val pageTitleResId = R.string.alarms_and_reminders_title
|
||||||
override val switchTitleResId = R.string.alarms_and_reminders_switch_title
|
override val switchTitleResId = R.string.alarms_and_reminders_switch_title
|
||||||
override val footerResId = R.string.alarms_and_reminders_footer_title
|
override val footerResId = R.string.alarms_and_reminders_footer_title
|
||||||
|
override val enhancedConfirmationKey: String = AppOpsManager.OPSTR_SCHEDULE_EXACT_ALARM
|
||||||
|
|
||||||
override fun transform(userIdFlow: Flow<Int>, appListFlow: Flow<List<ApplicationInfo>>) =
|
override fun transform(userIdFlow: Flow<Int>, appListFlow: Flow<List<ApplicationInfo>>) =
|
||||||
userIdFlow.map { userId ->
|
userIdFlow.map { userId ->
|
||||||
|
@@ -18,6 +18,7 @@ package com.android.settings.spa.app.specialaccess
|
|||||||
|
|
||||||
import android.Manifest
|
import android.Manifest
|
||||||
import android.app.AppGlobals
|
import android.app.AppGlobals
|
||||||
|
import android.app.AppOpsManager
|
||||||
import android.app.AppOpsManager.MODE_DEFAULT
|
import android.app.AppOpsManager.MODE_DEFAULT
|
||||||
import android.app.AppOpsManager.OP_REQUEST_INSTALL_PACKAGES
|
import android.app.AppOpsManager.OP_REQUEST_INSTALL_PACKAGES
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
@@ -55,6 +56,7 @@ class InstallUnknownAppsListModel(private val context: Context) :
|
|||||||
UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES,
|
UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES,
|
||||||
UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY,
|
UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY,
|
||||||
)
|
)
|
||||||
|
override val enhancedConfirmationKey: String = AppOpsManager.OPSTR_REQUEST_INSTALL_PACKAGES
|
||||||
|
|
||||||
override fun transformItem(app: ApplicationInfo) =
|
override fun transformItem(app: ApplicationInfo) =
|
||||||
InstallUnknownAppsRecord(
|
InstallUnknownAppsRecord(
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.settings.spa.app.specialaccess
|
package com.android.settings.spa.app.specialaccess
|
||||||
|
|
||||||
|
import android.app.AppOpsManager
|
||||||
import android.app.AppOpsManager.OP_PICTURE_IN_PICTURE
|
import android.app.AppOpsManager.OP_PICTURE_IN_PICTURE
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.pm.ActivityInfo
|
import android.content.pm.ActivityInfo
|
||||||
@@ -53,6 +54,7 @@ class PictureInPictureListModel(private val context: Context) :
|
|||||||
override val pageTitleResId = R.string.picture_in_picture_title
|
override val pageTitleResId = R.string.picture_in_picture_title
|
||||||
override val switchTitleResId = R.string.picture_in_picture_app_detail_switch
|
override val switchTitleResId = R.string.picture_in_picture_app_detail_switch
|
||||||
override val footerResId = R.string.picture_in_picture_app_detail_summary
|
override val footerResId = R.string.picture_in_picture_app_detail_summary
|
||||||
|
override val enhancedConfirmationKey: String = AppOpsManager.OPSTR_PICTURE_IN_PICTURE
|
||||||
|
|
||||||
private val packageManager = context.packageManager
|
private val packageManager = context.packageManager
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user