Merge "Rename RESULT_SUCCESS to RESULT_POLICY_SET" into udc-dev
diff --git a/core/api/current.txt b/core/api/current.txt
index 6078712f..7b97a65 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -8332,7 +8332,7 @@
field public static final int RESULT_FAILURE_STORAGE_LIMIT_REACHED = 3; // 0x3
field public static final int RESULT_FAILURE_UNKNOWN = -1; // 0xffffffff
field public static final int RESULT_POLICY_CLEARED = 2; // 0x2
- field public static final int RESULT_SUCCESS = 0; // 0x0
+ field public static final int RESULT_POLICY_SET = 0; // 0x0
}
public final class PreferentialNetworkServiceConfig implements android.os.Parcelable {
diff --git a/core/java/android/app/admin/PolicyUpdateReceiver.java b/core/java/android/app/admin/PolicyUpdateReceiver.java
index b5d9286..be13988 100644
--- a/core/java/android/app/admin/PolicyUpdateReceiver.java
+++ b/core/java/android/app/admin/PolicyUpdateReceiver.java
@@ -238,7 +238,7 @@
* needed.
* @param targetUser The {@link TargetUser} which this policy relates to.
* @param policyUpdateResult Indicates whether the policy has been set successfully
- * ({@link PolicyUpdateResult#RESULT_SUCCESS}) or the reason it
+ * ({@link PolicyUpdateResult#RESULT_POLICY_SET}) or the reason it
* failed to apply (e.g.
* {@link PolicyUpdateResult#RESULT_FAILURE_CONFLICTING_ADMIN_POLICY},
* etc).
@@ -271,8 +271,8 @@
* needed.
* @param targetUser The {@link TargetUser} which this policy relates to.
* @param policyUpdateResult Indicates the reason the policy value has changed
- * (e.g. {@link PolicyUpdateResult#RESULT_SUCCESS} if the policy has
- * changed to the value set by the admin,
+ * (e.g. {@link PolicyUpdateResult#RESULT_POLICY_SET} if the policy
+ * has changed to the value set by the admin,
* {@link PolicyUpdateResult#RESULT_FAILURE_CONFLICTING_ADMIN_POLICY}
* if the policy has changed because another admin has set a
* conflicting policy, etc)
diff --git a/core/java/android/app/admin/PolicyUpdateResult.java b/core/java/android/app/admin/PolicyUpdateResult.java
index 7d7d91a..414c6ed 100644
--- a/core/java/android/app/admin/PolicyUpdateResult.java
+++ b/core/java/android/app/admin/PolicyUpdateResult.java
@@ -39,7 +39,7 @@
* Result code to indicate that the policy has been changed to the desired value set by
* the admin.
*/
- public static final int RESULT_SUCCESS = 0;
+ public static final int RESULT_POLICY_SET = 0;
/**
* Result code to indicate that the policy has not been enforced or has changed because another
@@ -82,7 +82,7 @@
@Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = { "RESULT_" }, value = {
RESULT_FAILURE_UNKNOWN,
- RESULT_SUCCESS,
+ RESULT_POLICY_SET,
RESULT_FAILURE_CONFLICTING_ADMIN_POLICY,
RESULT_POLICY_CLEARED,
RESULT_FAILURE_STORAGE_LIMIT_REACHED,
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyEngine.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyEngine.java
index c7f9952..ec101cd 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyEngine.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyEngine.java
@@ -18,9 +18,9 @@
import static android.app.admin.PolicyUpdateResult.RESULT_FAILURE_CONFLICTING_ADMIN_POLICY;
import static android.app.admin.PolicyUpdateResult.RESULT_POLICY_CLEARED;
-import static android.app.admin.PolicyUpdateResult.RESULT_SUCCESS;
import static android.app.admin.PolicyUpdateReceiver.EXTRA_POLICY_TARGET_USER_ID;
import static android.app.admin.PolicyUpdateReceiver.EXTRA_POLICY_UPDATE_RESULT_KEY;
+import static android.app.admin.PolicyUpdateResult.RESULT_POLICY_SET;
import static android.content.pm.UserProperties.INHERIT_DEVICE_POLICY_FROM_PARENT;
import static android.provider.DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER;
@@ -167,7 +167,8 @@
enforcingAdmin,
policyDefinition,
// TODO: we're always sending this for now, should properly handle errors.
- policyEnforced ? RESULT_SUCCESS : RESULT_FAILURE_CONFLICTING_ADMIN_POLICY,
+ policyEnforced
+ ? RESULT_POLICY_SET : RESULT_FAILURE_CONFLICTING_ADMIN_POLICY,
userId);
}
@@ -400,7 +401,7 @@
enforcingAdmin,
policyDefinition,
// TODO: we're always sending this for now, should properly handle errors.
- policyApplied ? RESULT_SUCCESS : RESULT_FAILURE_CONFLICTING_ADMIN_POLICY,
+ policyApplied ? RESULT_POLICY_SET : RESULT_FAILURE_CONFLICTING_ADMIN_POLICY,
UserHandle.USER_ALL);
}
@@ -792,7 +793,7 @@
int result = Objects.equals(
policyState.getPoliciesSetByAdmins().get(admin),
policyState.getCurrentResolvedPolicy())
- ? RESULT_SUCCESS : RESULT_FAILURE_CONFLICTING_ADMIN_POLICY;
+ ? RESULT_POLICY_SET : RESULT_FAILURE_CONFLICTING_ADMIN_POLICY;
maybeSendOnPolicyChanged(
admin, policyDefinition, result, userId);
}