diff options
author | 2024-12-30 10:21:48 -0800 | |
---|---|---|
committer | 2025-01-15 15:35:34 -0800 | |
commit | 521fcc503b0cad14017181cd2bb63a295346c480 (patch) | |
tree | 5388bb7c6fdec077505621f455acccd153c11bc9 /framework-s | |
parent | 91adae30e12397c3f55c4c7e4e251da344f2e086 (diff) |
Separate per-package and global restricted ECM settings
If an ECM setting is restricted only by global device state, then it
should not be checked for a per-package restriction.
Fixes: 385317771
Test: atest EnhancedConfirmationInCallTest
Flag:
android.permission.flags.enhanced_confirmation_in_call_apis_enabled
Relnote: 25Q2 feature work
LOW_COVERAGE_REASON=b/387927331
Change-Id: Ia78acdca3071af6310d5bd5ce2c4db0c30195478
Diffstat (limited to 'framework-s')
-rw-r--r-- | framework-s/java/android/app/ecm/EnhancedConfirmationManager.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/framework-s/java/android/app/ecm/EnhancedConfirmationManager.java b/framework-s/java/android/app/ecm/EnhancedConfirmationManager.java index 290388558..4248a429c 100644 --- a/framework-s/java/android/app/ecm/EnhancedConfirmationManager.java +++ b/framework-s/java/android/app/ecm/EnhancedConfirmationManager.java @@ -213,7 +213,7 @@ public final class EnhancedConfirmationManager { * The setting is restricted because the restricted app op is set for the given package * @hide */ - public static final String REASON_APP_OP_RESTRICTED = "app_op_restricted"; + public static final String REASON_PACKAGE_RESTRICTED = "package_restricted"; /** A map of ECM states to their corresponding app op states */ @@ -367,8 +367,9 @@ public final class EnhancedConfirmationManager { intent.putExtra(Intent.EXTRA_UID, uid); intent.putExtra(Intent.EXTRA_SUBJECT, settingIdentifier); try { - intent.putExtra(Intent.EXTRA_REASON, mService.getRestrictionReason(packageName, - settingIdentifier, UserHandle.getUserHandleForUid(uid).getIdentifier())); + String restrictionReason = mService.getRestrictionReason(packageName, + settingIdentifier, UserHandle.getUserHandleForUid(uid).getIdentifier()); + intent.putExtra(Intent.EXTRA_REASON, restrictionReason); } catch (SecurityException | RemoteException e) { // The caller of this method does not have permission to read the ECM state, so we // won't include it in the return |