Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1461266a authored by Philip P. Moltmann's avatar Philip P. Moltmann Committed by android-build-merger
Browse files

Merge "Whitelist all perms on installExistingPackage" into qt-dev am: 4f09b09f

am: 55dc51e9

Change-Id: Ic1a680f6ce0d7218040f13b44bb42b31f8204793
parents 69f4537c 55dc51e9
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -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");
            }
            }
+1 −1
Original line number Original line Diff line number Diff line
@@ -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);
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -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);
+7 −2
Original line number Original line Diff line number Diff line
@@ -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.
@@ -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();
        }
        }
+2 −1
Original line number Original line Diff line number Diff line
@@ -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