Merge "Add ACTION_PROVISION_MANAGED_USER"
This commit is contained in:
committed by
Android (Google) Code Review
commit
68ce6dc10a
@@ -147,6 +147,14 @@ public class DevicePolicyManager {
|
||||
public static final String ACTION_PROVISION_MANAGED_PROFILE
|
||||
= "android.app.action.PROVISION_MANAGED_PROFILE";
|
||||
|
||||
/**
|
||||
* @hide
|
||||
* TODO Add Documentation
|
||||
*/
|
||||
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
|
||||
public static final String ACTION_PROVISION_MANAGED_USER
|
||||
= "android.app.action.PROVISION_MANAGED_USER";
|
||||
|
||||
/**
|
||||
* Activity action: Starts the provisioning flow which sets up a managed device.
|
||||
* Must be started with {@link android.app.Activity#startActivityForResult(Intent, int)}.
|
||||
|
||||
@@ -6676,6 +6676,11 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} else if (DevicePolicyManager.ACTION_PROVISION_MANAGED_USER.equals(action)) {
|
||||
if (hasUserSetupCompleted(callingUserId)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown provisioning action " + action);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user