List of usage examples for android.content.pm PackageManager INSTALL_FAILED_USER_RESTRICTED
int INSTALL_FAILED_USER_RESTRICTED
To view the source code for android.content.pm PackageManager INSTALL_FAILED_USER_RESTRICTED.
Click Source Link
From source file:com.android.managedprovisioning.ProfileOwnerProvisioningService.java
private void installMdmOnManagedProfile() throws ProvisioningException { ProvisionLogger.logd("Installing mobile device management app " + mParams.deviceAdminComponentName + " on managed profile"); try {/*from ww w . java2s. c o m*/ int status = mIpm.installExistingPackageAsUser(mParams.deviceAdminComponentName.getPackageName(), mManagedProfileOrUserInfo.id); switch (status) { case PackageManager.INSTALL_SUCCEEDED: return; case PackageManager.INSTALL_FAILED_USER_RESTRICTED: // Should not happen because we're not installing a restricted user throw raiseError("Could not install mobile device management app on managed " + "profile because the user is restricted"); case PackageManager.INSTALL_FAILED_INVALID_URI: // Should not happen because we already checked throw raiseError("Could not install mobile device management app on managed " + "profile because the package could not be found"); default: throw raiseError("Could not install mobile device management app on managed " + "profile. Unknown status: " + status); } } catch (RemoteException neverThrown) { // Never thrown, as we are making local calls. ProvisionLogger.loge("This should not happen.", neverThrown); } }