summaryrefslogtreecommitdiff
path: root/framework-s/java
diff options
context:
space:
mode:
author Nate Myren <ntmyren@google.com> 2024-12-03 15:48:29 -0800
committer Nate Myren <ntmyren@google.com> 2024-12-06 23:33:51 +0000
commit33dc5c7223185b27dba4402750b1b78f1f42a246 (patch)
tree8acba6bbe674d749cd4ffbccdc4e0096fab64612 /framework-s/java
parent3033e4837bb5958cf2d0ef8b8090867677570dbe (diff)
Add in-call version of ECM dialog, remove new ECM api
This dialog looks similar to the existing ECM dialog, but has a different message, about being blocked while in a phone call Also removes the ecm "isUnknownCallOngoing", in favor of using "isRestricted" Test: atest EnhancedConfirmationInCallTest Flag: android.permission.flags.unknown_call_package_install_blocking_enabled Relnote: android 25Q2 feature LOW_COVERAGE_REASON=FLAG_NOT_ENABLED Change-Id: I113114c15df3df483e290f0bab00f5cecb2b44f8
Diffstat (limited to 'framework-s/java')
-rw-r--r--framework-s/java/android/app/ecm/EnhancedConfirmationManager.java34
-rw-r--r--framework-s/java/android/app/ecm/IEnhancedConfirmationManager.aidl3
2 files changed, 7 insertions, 30 deletions
diff --git a/framework-s/java/android/app/ecm/EnhancedConfirmationManager.java b/framework-s/java/android/app/ecm/EnhancedConfirmationManager.java
index e497ba5f4..db05a0af6 100644
--- a/framework-s/java/android/app/ecm/EnhancedConfirmationManager.java
+++ b/framework-s/java/android/app/ecm/EnhancedConfirmationManager.java
@@ -42,7 +42,7 @@ import java.lang.annotation.Retention;
* This class provides the core API for ECM (Enhanced Confirmation Mode). ECM is a feature that
* restricts access to protected **settings** (i.e., sensitive resources) by restricted **apps**
* (apps from from dangerous sources, such as sideloaded packages or packages downloaded from a web
- * browser).
+ * browser), or restricts settings globally based on device state.
*
* <p>Specifically, this class provides the ability to:
*
@@ -70,6 +70,9 @@ import java.lang.annotation.Retention;
* particular app restricted is an implementation detail of ECM. However, the user is able to
* clear any restricted app's restriction status (i.e, un-restrict it), after which ECM will
* consider the app **not restricted**.
+ * <li>A setting may be globally restricted based on device state. In this case, any app may be
+ * automatically considered *restricted*, regardless of the app's restriction state. Users
+ * cannot un-restrict the app, in these cases.
* </ol>
*
* Why is ECM needed? Consider the following (pre-ECM) scenario:
@@ -199,15 +202,6 @@ public final class EnhancedConfirmationManager {
public static final String ACTION_SHOW_ECM_RESTRICTED_SETTING_DIALOG =
"android.app.ecm.action.SHOW_ECM_RESTRICTED_SETTING_DIALOG";
- /**
- * Shows a dialog indicating a setting has been blocked due to the phone state (such as being
- * on a call with an unknown number). Opened when a setting is blocked.
- */
- @SdkConstant(BROADCAST_INTENT_ACTION)
- @FlaggedApi(Flags.FLAG_ENHANCED_CONFIRMATION_IN_CALL_APIS_ENABLED)
- public static final String ACTION_SHOW_ECM_PHONE_STATE_BLOCKED_SETTING_DIALOG =
- "android.app.ecm.action.SHOW_ECM_PHONE_STATE_BLOCKED_SETTING_DIALOG";
-
/** A map of ECM states to their corresponding app op states */
@Retention(java.lang.annotation.RetentionPolicy.SOURCE)
@IntDef(prefix = {"ECM_STATE_"}, value = {EcmState.ECM_STATE_NOT_GUARDED,
@@ -321,6 +315,9 @@ public final class EnhancedConfirmationManager {
* <p>This should be called from the "Restricted setting" dialog (which {@link
* #createRestrictedSettingDialogIntent} directs to) upon being presented to the user.
*
+ * <p>This restriction clearing does not apply to any settings that are restricted based on
+ * global device state
+ *
* @param packageName package name of the application which should be considered acknowledged
* @throws NameNotFoundException if the provided package was not found
*/
@@ -337,23 +334,6 @@ public final class EnhancedConfirmationManager {
}
/**
- * Returns whether the enhanced confirmation system thinks a call with an unknown party is
- * occurring
- *
- * @hide
- */
- @SystemApi
- @FlaggedApi(Flags.FLAG_ENHANCED_CONFIRMATION_IN_CALL_APIS_ENABLED)
- @RequiresPermission(android.Manifest.permission.MANAGE_ENHANCED_CONFIRMATION_STATES)
- public boolean isUnknownCallOngoing() {
- try {
- return mService.isUntrustedCallOngoing();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
* Gets an intent that will open the "Restricted setting" dialog for the specified package
* and setting.
*
diff --git a/framework-s/java/android/app/ecm/IEnhancedConfirmationManager.aidl b/framework-s/java/android/app/ecm/IEnhancedConfirmationManager.aidl
index 833485890..5149daa49 100644
--- a/framework-s/java/android/app/ecm/IEnhancedConfirmationManager.aidl
+++ b/framework-s/java/android/app/ecm/IEnhancedConfirmationManager.aidl
@@ -30,7 +30,4 @@ interface IEnhancedConfirmationManager {
boolean isClearRestrictionAllowed(in String packageName, int userId);
void setClearRestrictionAllowed(in String packageName, int userId);
-
- boolean isUntrustedCallOngoing();
-
}