List of usage examples for android.app.admin DevicePolicyManager setActiveAdmin
@UnsupportedAppUsage public void setActiveAdmin(@NonNull ComponentName policyReceiver, boolean refreshing, int userHandle)
From source file:com.android.managedprovisioning.ProfileOwnerProvisioningService.java
private void setMdmAsActiveAdmin() { ProvisionLogger.logd("Setting package " + mParams.deviceAdminComponentName + " as active admin."); DevicePolicyManager dpm = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE); dpm.setActiveAdmin(mParams.deviceAdminComponentName, true /* refreshing*/, mManagedProfileOrUserInfo.id); }