diff --git a/api/system-current.txt b/api/system-current.txt index f8caa5f20a95f..1653ab54b3e1d 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -9096,6 +9096,7 @@ package android.content { field public static final java.lang.String ACTION_EDIT = "android.intent.action.EDIT"; field public static final java.lang.String ACTION_EXTERNAL_APPLICATIONS_AVAILABLE = "android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE"; field public static final java.lang.String ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE = "android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE"; + field public static final java.lang.String ACTION_FACTORY_RESET = "android.intent.action.FACTORY_RESET"; field public static final java.lang.String ACTION_FACTORY_TEST = "android.intent.action.FACTORY_TEST"; field public static final java.lang.String ACTION_GET_CONTENT = "android.intent.action.GET_CONTENT"; field public static final java.lang.String ACTION_GET_RESTRICTION_ENTRIES = "android.intent.action.GET_RESTRICTION_ENTRIES"; @@ -9259,6 +9260,7 @@ package android.content { field public static final java.lang.String EXTRA_DONT_KILL_APP = "android.intent.extra.DONT_KILL_APP"; field public static final java.lang.String EXTRA_EMAIL = "android.intent.extra.EMAIL"; field public static final java.lang.String EXTRA_EXCLUDE_COMPONENTS = "android.intent.extra.EXCLUDE_COMPONENTS"; + field public static final java.lang.String EXTRA_FORCE_FACTORY_RESET = "android.intent.extra.FORCE_FACTORY_RESET"; field public static final java.lang.String EXTRA_HTML_TEXT = "android.intent.extra.HTML_TEXT"; field public static final java.lang.String EXTRA_INDEX = "android.intent.extra.INDEX"; field public static final java.lang.String EXTRA_INITIAL_INTENTS = "android.intent.extra.INITIAL_INTENTS"; diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index cda81760c52b6..16af5e1c45a2f 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -3226,17 +3226,53 @@ public class Intent implements Parcelable, Cloneable { public static final String ACTION_DYNAMIC_SENSOR_CHANGED = "android.intent.action.DYNAMIC_SENSOR_CHANGED"; - /** {@hide} */ + /** + * Deprecated - use {@link #ACTION_FACTORY_RESET} instead. + * + * {@hide} + */ + @Deprecated public static final String ACTION_MASTER_CLEAR = "android.intent.action.MASTER_CLEAR"; /** - * Boolean intent extra to be used with {@link ACTION_MASTER_CLEAR} in order to force a factory - * reset even if {@link android.os.UserManager.DISALLOW_FACTORY_RESET} is set. + * Boolean intent extra to be used with {@link #ACTION_MASTER_CLEAR} in order to force a factory + * reset even if {@link android.os.UserManager#DISALLOW_FACTORY_RESET} is set. + * + *
Deprecated - use {@link #EXTRA_FORCE_FACTORY_RESET} instead. + * * @hide */ + @Deprecated public static final String EXTRA_FORCE_MASTER_CLEAR = "android.intent.extra.FORCE_MASTER_CLEAR"; + /** + * A broadcast action to trigger a factory reset. + * + *
The sender must hold the {@link android.Manifest.permission#MASTER_CLEAR} permission. + * + *
Not for use by third-party applications. + * + * @see #EXTRA_FORCE_MASTER_CLEAR + * + * {@hide} + */ + @SystemApi + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_FACTORY_RESET = "android.intent.action.FACTORY_RESET"; + + /** + * Boolean intent extra to be used with {@link #ACTION_MASTER_CLEAR} in order to force a factory + * reset even if {@link android.os.UserManager#DISALLOW_FACTORY_RESET} is set. + * + *
Not for use by third-party applications.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final String EXTRA_FORCE_FACTORY_RESET =
+ "android.intent.extra.FORCE_FACTORY_RESET";
+
/**
* Broadcast action: report that a settings element is being restored from backup. The intent
* contains three extras: EXTRA_SETTING_NAME is a string naming the restored setting,
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 40fd8813d768f..bc04062563602 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -3393,7 +3393,10 @@
android:permission="android.permission.MASTER_CLEAR">