[ECM] Implement EnhancedConfirmationDialog in PC
The dialog currently used by ECM to show the "Restricted setting" dialog (which gets displayed when a user tries to perform a restricted operation) is currently ActionDisabledByAppOpsDialog, which is hosted in Settings. We want to move this dialog out of Settings and into PermissionController. The existing dialog is also used for other features, so: (1) we won't delete the existing dialog, and (2) we can remove some code in the new dialog. This change essentially does the following: 1. Copy the dialog from Settings into PermissionController 2. Rename things to reflect the dialog's new name: EnhancedConfirmationDialog 3. Use ECM-for-V behavior: call setClearRestrictionAllowed instead of setting an appop directly 4. Remove unused code and resources Note that nothing is pointing at this new dialog just yet. To test opening the dialog manually, run: (EXTRA_PACKAGE_NAME='com.android.chrome'; EXTRA_UID=$(adb shell pm list packages -U \ | grep ${EXTRA_PACKAGE_NAME} | sed 's/.*uid://'); adb shell am start \ -a android.app.ecm.action.SHOW_ECM_RESTRICTED_SETTING_DIALOG \ -e android.intent.extra.PACKAGE_NAME ${EXTRA_PACKAGE_NAME} \ --ei android.intent.extra.UID ${EXTRA_UID}) LOW_COVERAGE_REASON=other: Not in use yet. Will add tests in follow-up. Bug: 322026141 Test: see above Change-Id: I3fb866e06146c830b3daf38c0dd194538dfd239b
Loading
Please register or sign in to comment