Loading core/java/android/app/ApplicationPackageManager.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -1920,8 +1920,8 @@ public class ApplicationPackageManager extends PackageManager { private int installExistingPackageAsUser(String packageName, int installReason, int userId) private int installExistingPackageAsUser(String packageName, int installReason, int userId) throws NameNotFoundException { throws NameNotFoundException { try { try { int res = mPM.installExistingPackageAsUser(packageName, userId, 0 /*installFlags*/, int res = mPM.installExistingPackageAsUser(packageName, userId, installReason); INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS, installReason, null); if (res == INSTALL_FAILED_INVALID_URI) { if (res == INSTALL_FAILED_INVALID_URI) { throw new NameNotFoundException("Package " + packageName + " doesn't exist"); throw new NameNotFoundException("Package " + packageName + " doesn't exist"); } } Loading core/java/android/content/pm/IPackageInstaller.aidl +1 −1 Original line number Original line Diff line number Diff line Loading @@ -52,7 +52,7 @@ interface IPackageInstaller { in IntentSender statusReceiver, int userId); in IntentSender statusReceiver, int userId); void installExistingPackage(String packageName, int installFlags, int installReason, void installExistingPackage(String packageName, int installFlags, int installReason, in IntentSender statusReceiver, int userId); in IntentSender statusReceiver, int userId, in List<String> whiteListedPermissions); void setPermissionsResult(int sessionId, boolean accepted); void setPermissionsResult(int sessionId, boolean accepted); } } core/java/android/content/pm/IPackageManager.aidl +1 −1 Original line number Original line Diff line number Diff line Loading @@ -634,7 +634,7 @@ interface IPackageManager { int getInstallLocation(); int getInstallLocation(); int installExistingPackageAsUser(String packageName, int userId, int installFlags, int installExistingPackageAsUser(String packageName, int userId, int installFlags, int installReason); int installReason, in List<String> whiteListedPermissions); void verifyPendingInstall(int id, int verificationCode); void verifyPendingInstall(int id, int verificationCode); void extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay); void extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay); Loading core/java/android/content/pm/PackageInstaller.java +7 −2 Original line number Original line Diff line number Diff line Loading @@ -627,6 +627,10 @@ public class PackageInstaller { * Install the given package, which already exists on the device, for the user for which this * Install the given package, which already exists on the device, for the user for which this * installer was created. * installer was created. * * * <p>This will * {@link PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set) whitelist * all restricted permissions}. * * @param packageName The package to install. * @param packageName The package to install. * @param installReason Reason for install. * @param installReason Reason for install. * @param statusReceiver Where to deliver the result. * @param statusReceiver Where to deliver the result. Loading @@ -639,8 +643,9 @@ public class PackageInstaller { @Nullable IntentSender statusReceiver) { @Nullable IntentSender statusReceiver) { Preconditions.checkNotNull(packageName, "packageName cannot be null"); Preconditions.checkNotNull(packageName, "packageName cannot be null"); try { try { mInstaller.installExistingPackage(packageName, 0, installReason, statusReceiver, mInstaller.installExistingPackage(packageName, mUserId); PackageManager.INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS, installReason, statusReceiver, mUserId, null); } catch (RemoteException e) { } catch (RemoteException e) { throw e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading packages/SettingsLib/src/com/android/settingslib/users/AppRestrictionsHelper.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -117,7 +117,8 @@ public class AppRestrictionsHelper { if (info == null || !info.enabled if (info == null || !info.enabled || (info.flags&ApplicationInfo.FLAG_INSTALLED) == 0) { || (info.flags&ApplicationInfo.FLAG_INSTALLED) == 0) { mIPm.installExistingPackageAsUser(packageName, mUser.getIdentifier(), mIPm.installExistingPackageAsUser(packageName, mUser.getIdentifier(), 0 /*installFlags*/, PackageManager.INSTALL_REASON_UNKNOWN); PackageManager.INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS, PackageManager.INSTALL_REASON_UNKNOWN, null); if (DEBUG) { if (DEBUG) { Log.d(TAG, "Installing " + packageName); Log.d(TAG, "Installing " + packageName); } } Loading Loading
core/java/android/app/ApplicationPackageManager.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -1920,8 +1920,8 @@ public class ApplicationPackageManager extends PackageManager { private int installExistingPackageAsUser(String packageName, int installReason, int userId) private int installExistingPackageAsUser(String packageName, int installReason, int userId) throws NameNotFoundException { throws NameNotFoundException { try { try { int res = mPM.installExistingPackageAsUser(packageName, userId, 0 /*installFlags*/, int res = mPM.installExistingPackageAsUser(packageName, userId, installReason); INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS, installReason, null); if (res == INSTALL_FAILED_INVALID_URI) { if (res == INSTALL_FAILED_INVALID_URI) { throw new NameNotFoundException("Package " + packageName + " doesn't exist"); throw new NameNotFoundException("Package " + packageName + " doesn't exist"); } } Loading
core/java/android/content/pm/IPackageInstaller.aidl +1 −1 Original line number Original line Diff line number Diff line Loading @@ -52,7 +52,7 @@ interface IPackageInstaller { in IntentSender statusReceiver, int userId); in IntentSender statusReceiver, int userId); void installExistingPackage(String packageName, int installFlags, int installReason, void installExistingPackage(String packageName, int installFlags, int installReason, in IntentSender statusReceiver, int userId); in IntentSender statusReceiver, int userId, in List<String> whiteListedPermissions); void setPermissionsResult(int sessionId, boolean accepted); void setPermissionsResult(int sessionId, boolean accepted); } }
core/java/android/content/pm/IPackageManager.aidl +1 −1 Original line number Original line Diff line number Diff line Loading @@ -634,7 +634,7 @@ interface IPackageManager { int getInstallLocation(); int getInstallLocation(); int installExistingPackageAsUser(String packageName, int userId, int installFlags, int installExistingPackageAsUser(String packageName, int userId, int installFlags, int installReason); int installReason, in List<String> whiteListedPermissions); void verifyPendingInstall(int id, int verificationCode); void verifyPendingInstall(int id, int verificationCode); void extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay); void extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay); Loading
core/java/android/content/pm/PackageInstaller.java +7 −2 Original line number Original line Diff line number Diff line Loading @@ -627,6 +627,10 @@ public class PackageInstaller { * Install the given package, which already exists on the device, for the user for which this * Install the given package, which already exists on the device, for the user for which this * installer was created. * installer was created. * * * <p>This will * {@link PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set) whitelist * all restricted permissions}. * * @param packageName The package to install. * @param packageName The package to install. * @param installReason Reason for install. * @param installReason Reason for install. * @param statusReceiver Where to deliver the result. * @param statusReceiver Where to deliver the result. Loading @@ -639,8 +643,9 @@ public class PackageInstaller { @Nullable IntentSender statusReceiver) { @Nullable IntentSender statusReceiver) { Preconditions.checkNotNull(packageName, "packageName cannot be null"); Preconditions.checkNotNull(packageName, "packageName cannot be null"); try { try { mInstaller.installExistingPackage(packageName, 0, installReason, statusReceiver, mInstaller.installExistingPackage(packageName, mUserId); PackageManager.INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS, installReason, statusReceiver, mUserId, null); } catch (RemoteException e) { } catch (RemoteException e) { throw e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading
packages/SettingsLib/src/com/android/settingslib/users/AppRestrictionsHelper.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -117,7 +117,8 @@ public class AppRestrictionsHelper { if (info == null || !info.enabled if (info == null || !info.enabled || (info.flags&ApplicationInfo.FLAG_INSTALLED) == 0) { || (info.flags&ApplicationInfo.FLAG_INSTALLED) == 0) { mIPm.installExistingPackageAsUser(packageName, mUser.getIdentifier(), mIPm.installExistingPackageAsUser(packageName, mUser.getIdentifier(), 0 /*installFlags*/, PackageManager.INSTALL_REASON_UNKNOWN); PackageManager.INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS, PackageManager.INSTALL_REASON_UNKNOWN, null); if (DEBUG) { if (DEBUG) { Log.d(TAG, "Installing " + packageName); Log.d(TAG, "Installing " + packageName); } } Loading