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/api/system-current.txt b/api/system-current.txt
index da15176..f0dab73 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -6280,6 +6280,8 @@
method public boolean isCallerApplicationRestrictionsManagingPackage();
method public boolean isDeviceManaged();
method public boolean isDeviceOwnerApp(java.lang.String);
+ method public boolean isDeviceProvisioned();
+ method public boolean isDeviceProvisioningConfigApplied();
method public boolean isLockTaskPermitted(java.lang.String);
method public boolean isManagedProfile(android.content.ComponentName);
method public boolean isMasterVolumeMuted(android.content.ComponentName);
@@ -6315,6 +6317,7 @@
method public void setCrossProfileCallerIdDisabled(android.content.ComponentName, boolean);
method public void setCrossProfileContactsSearchDisabled(android.content.ComponentName, boolean);
method public void setDeviceOwnerLockScreenInfo(android.content.ComponentName, java.lang.CharSequence);
+ method public void setDeviceProvisioningConfigApplied();
method public void setGlobalSetting(android.content.ComponentName, java.lang.String, java.lang.String);
method public boolean setKeyguardDisabled(android.content.ComponentName, boolean);
method public void setKeyguardDisabledFeatures(android.content.ComponentName, int);
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();