Tweak SystemUpdatePolicy according to API review.
Make SystemUpdatePolicy Parcelable; hide public constructor and
expose static builder methods.
Bug: 20820025
Change-Id: I594ba3c7e5514551134ba6c866b24498b66506bf
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index ae07206..3fb7059 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -4253,11 +4253,7 @@
public void setSystemUpdatePolicy(ComponentName who, SystemUpdatePolicy policy) {
if (mService != null) {
try {
- if (policy != null) {
- mService.setSystemUpdatePolicy(who, policy.getPolicyBundle());
- } else {
- mService.setSystemUpdatePolicy(who, null);
- }
+ mService.setSystemUpdatePolicy(who, policy);
} catch (RemoteException re) {
Log.w(TAG, "Error calling setSystemUpdatePolicy", re);
}
@@ -4272,12 +4268,7 @@
public SystemUpdatePolicy getSystemUpdatePolicy() {
if (mService != null) {
try {
- PersistableBundle bundle = mService.getSystemUpdatePolicy();
- if (bundle != null) {
- return new SystemUpdatePolicy(bundle);
- } else {
- return null;
- }
+ return mService.getSystemUpdatePolicy();
} catch (RemoteException re) {
Log.w(TAG, "Error calling getSystemUpdatePolicy", re);
}