Merge "Rename RESULT_SUCCESS to RESULT_POLICY_SET" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b04a48fa32
@@ -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_STORAGE_LIMIT_REACHED = 3; // 0x3
|
||||||
field public static final int RESULT_FAILURE_UNKNOWN = -1; // 0xffffffff
|
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_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 {
|
public final class PreferentialNetworkServiceConfig implements android.os.Parcelable {
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ public abstract class PolicyUpdateReceiver extends BroadcastReceiver {
|
|||||||
* needed.
|
* needed.
|
||||||
* @param targetUser The {@link TargetUser} which this policy relates to.
|
* @param targetUser The {@link TargetUser} which this policy relates to.
|
||||||
* @param policyUpdateResult Indicates whether the policy has been set successfully
|
* @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.
|
* failed to apply (e.g.
|
||||||
* {@link PolicyUpdateResult#RESULT_FAILURE_CONFLICTING_ADMIN_POLICY},
|
* {@link PolicyUpdateResult#RESULT_FAILURE_CONFLICTING_ADMIN_POLICY},
|
||||||
* etc).
|
* etc).
|
||||||
@@ -271,8 +271,8 @@ public abstract class PolicyUpdateReceiver extends BroadcastReceiver {
|
|||||||
* needed.
|
* needed.
|
||||||
* @param targetUser The {@link TargetUser} which this policy relates to.
|
* @param targetUser The {@link TargetUser} which this policy relates to.
|
||||||
* @param policyUpdateResult Indicates the reason the policy value has changed
|
* @param policyUpdateResult Indicates the reason the policy value has changed
|
||||||
* (e.g. {@link PolicyUpdateResult#RESULT_SUCCESS} if the policy has
|
* (e.g. {@link PolicyUpdateResult#RESULT_POLICY_SET} if the policy
|
||||||
* changed to the value set by the admin,
|
* has changed to the value set by the admin,
|
||||||
* {@link PolicyUpdateResult#RESULT_FAILURE_CONFLICTING_ADMIN_POLICY}
|
* {@link PolicyUpdateResult#RESULT_FAILURE_CONFLICTING_ADMIN_POLICY}
|
||||||
* if the policy has changed because another admin has set a
|
* if the policy has changed because another admin has set a
|
||||||
* conflicting policy, etc)
|
* 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
|
* Result code to indicate that the policy has been changed to the desired value set by
|
||||||
* the admin.
|
* 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
|
* 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)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@IntDef(prefix = { "RESULT_" }, value = {
|
@IntDef(prefix = { "RESULT_" }, value = {
|
||||||
RESULT_FAILURE_UNKNOWN,
|
RESULT_FAILURE_UNKNOWN,
|
||||||
RESULT_SUCCESS,
|
RESULT_POLICY_SET,
|
||||||
RESULT_FAILURE_CONFLICTING_ADMIN_POLICY,
|
RESULT_FAILURE_CONFLICTING_ADMIN_POLICY,
|
||||||
RESULT_POLICY_CLEARED,
|
RESULT_POLICY_CLEARED,
|
||||||
RESULT_FAILURE_STORAGE_LIMIT_REACHED,
|
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_FAILURE_CONFLICTING_ADMIN_POLICY;
|
||||||
import static android.app.admin.PolicyUpdateResult.RESULT_POLICY_CLEARED;
|
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_TARGET_USER_ID;
|
||||||
import static android.app.admin.PolicyUpdateReceiver.EXTRA_POLICY_UPDATE_RESULT_KEY;
|
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.content.pm.UserProperties.INHERIT_DEVICE_POLICY_FROM_PARENT;
|
||||||
import static android.provider.DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER;
|
import static android.provider.DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER;
|
||||||
|
|
||||||
@@ -167,7 +167,8 @@ final class DevicePolicyEngine {
|
|||||||
enforcingAdmin,
|
enforcingAdmin,
|
||||||
policyDefinition,
|
policyDefinition,
|
||||||
// TODO: we're always sending this for now, should properly handle errors.
|
// 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);
|
userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -400,7 +401,7 @@ final class DevicePolicyEngine {
|
|||||||
enforcingAdmin,
|
enforcingAdmin,
|
||||||
policyDefinition,
|
policyDefinition,
|
||||||
// TODO: we're always sending this for now, should properly handle errors.
|
// 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);
|
UserHandle.USER_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -792,7 +793,7 @@ final class DevicePolicyEngine {
|
|||||||
int result = Objects.equals(
|
int result = Objects.equals(
|
||||||
policyState.getPoliciesSetByAdmins().get(admin),
|
policyState.getPoliciesSetByAdmins().get(admin),
|
||||||
policyState.getCurrentResolvedPolicy())
|
policyState.getCurrentResolvedPolicy())
|
||||||
? RESULT_SUCCESS : RESULT_FAILURE_CONFLICTING_ADMIN_POLICY;
|
? RESULT_POLICY_SET : RESULT_FAILURE_CONFLICTING_ADMIN_POLICY;
|
||||||
maybeSendOnPolicyChanged(
|
maybeSendOnPolicyChanged(
|
||||||
admin, policyDefinition, result, userId);
|
admin, policyDefinition, result, userId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user