diff options
| author | Elis Elliott <eliselliott@google.com> | 2022-01-18 16:46:51 +0000 |
|---|---|---|
| committer | Elis Elliott <eliselliott@google.com> | 2022-02-03 11:06:54 +0000 |
| commit | d603ad791686f483156bd2cc76c8d72b8bf3079e (patch) | |
| tree | e5f3bd9a5a2e247b0f9b5faf9afce74eb79e73d2 /core/java | |
| parent | 499454759689e38bce250762d64f51ad20d525c3 (diff) | |
Expose MANAGED_PROVISIONING_DPC_DOWNLOADED via DevicePolicyManager
Expose Settings.Secure.MANAGED_PROVISIONING_DPC_DOWNLOADED by adding
getter & setter methods in DevicePolicyManager.
Bug: 212679631
Test: android.devicepolicy.cts.DevicePolicyManagerTest
Change-Id: I9c8c69ec494fcbf82965308b76f6e27e5184ba4d
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/admin/DevicePolicyManager.java | 41 | ||||
| -rw-r--r-- | core/java/android/app/admin/IDevicePolicyManager.aidl | 3 |
2 files changed, 44 insertions, 0 deletions
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index a4227a4d3074..5cb8690a5de1 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -15334,4 +15334,45 @@ public class DevicePolicyManager { } return ParcelableResource.loadDefaultString(defaultStringLoader); } + + /** + * Returns a boolean for whether the DPC has been downloaded during provisioning. + * + * <p>If true is returned, then any attempts to begin setup again should result in factory reset + * + * @hide + */ + @SystemApi + @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) + public boolean isDpcDownloaded() { + throwIfParentInstance("isDpcDownloaded"); + if (mService != null) { + try { + return mService.isDpcDownloaded(); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + return false; + } + + /** + * Use to indicate that the DPC has or has not been downloaded during provisioning. + * + * @param downloaded {@code true} if the dpc has been downloaded during provisioning. false otherwise. + * + * @hide + */ + @SystemApi + @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) + public void setDpcDownloaded(boolean downloaded) { + throwIfParentInstance("setDpcDownloaded"); + if (mService != null) { + try { + mService.setDpcDownloaded(downloaded); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + } } diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl index 927ee0c20eaf..a7a9a0e3ed92 100644 --- a/core/java/android/app/admin/IDevicePolicyManager.aidl +++ b/core/java/android/app/admin/IDevicePolicyManager.aidl @@ -554,6 +554,9 @@ interface IDevicePolicyManager { void resetDrawables(in String[] drawableIds); ParcelableResource getDrawable(String drawableId, String drawableStyle, String drawableSource); + boolean isDpcDownloaded(); + void setDpcDownloaded(boolean downloaded); + void setStrings(in List<DevicePolicyStringResource> strings); void resetStrings(in String[] stringIds); ParcelableResource getString(String stringId); |
