Rename RESULT_SUCCESS to RESULT_POLICY_SET
Bug: 271108424 Test: m Change-Id: I417fc582bf6bb007e910a3715d1d307ded1601b6
This commit is contained in:
@@ -8332,7 +8332,7 @@ package android.app.admin {
|
||||
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 {
|
||||
|
||||
@@ -238,7 +238,7 @@ public abstract class PolicyUpdateReceiver extends BroadcastReceiver {
|
||||
* 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 @@ public abstract class PolicyUpdateReceiver extends BroadcastReceiver {
|
||||
* 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)
|
||||
|
||||
@@ -39,7 +39,7 @@ public final class PolicyUpdateResult {
|
||||
* 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 @@ public final class PolicyUpdateResult {
|
||||
@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,
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.android.server.devicepolicy;
|
||||
|
||||
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 @@ final class DevicePolicyEngine {
|
||||
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 @@ final class DevicePolicyEngine {
|
||||
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 @@ final class DevicePolicyEngine {
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user