Make master clear constants system APIs.
This is needed for unbundling of the OobConfig apk.
Test: gts-tradefed run gts -m GtsGmscoreHostTestCases --test com.google.android.gts.devicepolicy.DeviceOwnerUserRestrictionTest#testFactoryReset_disallowFactoryReset
Bug: 32974361
Change-Id: I71e7270bb4c3234ec0516382b18a2ca35aab4c81
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index cda8176..16af5e1 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -3226,18 +3226,54 @@
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.
+ *
+ * <p>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.
+ *
+ * <p> The sender must hold the {@link android.Manifest.permission#MASTER_CLEAR} permission.
+ *
+ * <p>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.
+ *
+ * <p>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,
* EXTRA_SETTING_NEW_VALUE is the value being restored, and EXTRA_SETTING_PREVIOUS_VALUE