DevicePolicyManager: make 3 hidden provisioning methods system API.
In order to unbundle OobConfig app, make the following
methods @SystemAPI:
- DevicePolicyManager#isDeviceProvisioned
- DevicePolicyManager#setDeviceProvisioningConfigApplied
- DevicePolicyManager#isDeviceProvisioningConfigApplied
Test: gts-tradefed run gts -m GtsGmscoreHostTestCases --test com.google.android.gts.devicepolicy.DevicePolicyManagerTest
Bug: 32972931
Change-Id: Ic33b6c570222e4aa31cf7975a39de0d9e2614534
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 39f415e..07030d9 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -6827,10 +6827,13 @@
}
/**
+ * Returns whether the device has been provisioned.
+ *
+ * <p>Not for use by third-party applications.
+ *
* @hide
- * @return whether {@link android.provider.Settings.Global#DEVICE_PROVISIONED} has ever been set
- * to 1.
*/
+ @SystemApi
public boolean isDeviceProvisioned() {
try {
return mService.isDeviceProvisioned();
@@ -6840,9 +6843,16 @@
}
/**
- * @hide
- * Writes that the provisioning configuration has been applied.
- */
+ * Writes that the provisioning configuration has been applied.
+ *
+ * <p>The caller must hold the {@link android.Manifest.permission#MANAGE_USERS}
+ * permission.
+ *
+ * <p>Not for use by third-party applications.
+ *
+ * @hide
+ */
+ @SystemApi
public void setDeviceProvisioningConfigApplied() {
try {
mService.setDeviceProvisioningConfigApplied();
@@ -6852,9 +6862,17 @@
}
/**
- * @hide
+ * Returns whether the provisioning configuration has been applied.
+ *
+ * <p>The caller must hold the {@link android.Manifest.permission#MANAGE_USERS} permission.
+ *
+ * <p>Not for use by third-party applications.
+ *
* @return whether the provisioning configuration has been applied.
+ *
+ * @hide
*/
+ @SystemApi
public boolean isDeviceProvisioningConfigApplied() {
try {
return mService.isDeviceProvisioningConfigApplied();