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

Commit 88975abd authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Merge "Prevent system reset staged installer bypass flag unexpactly"...

Merge "Merge "Prevent system reset staged installer bypass flag unexpactly" into rvc-dev am: 809bf935 am: d03b5017 am: 6a0ff25f" into rvc-qpr-dev-plus-aosp am: 7034afae

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12106109

Change-Id: I90e0bb48d8bdd26721af22b73d71e789853b9011
parents caaebbfc 7034afae
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -592,13 +592,13 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
            }
        }

        if (params.isStaged && !isCalledBySystemOrShell(callingUid)) {
            if (mBypassNextStagedInstallerCheck) {
                mBypassNextStagedInstallerCheck = false;
        } else if (params.isStaged
                && !isCalledBySystemOrShell(callingUid)
                && !isWhitelistedStagedInstaller(requestedInstallerPackageName)) {
            } else if (!isStagedInstallerAllowed(requestedInstallerPackageName)) {
                throw new SecurityException("Installer not allowed to commit staged install");
            }
        }

        if (!params.isMultiPackage) {
            // Only system components can circumvent runtime permissions when installing.
@@ -729,7 +729,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
                || callingUid == Process.SHELL_UID;
    }

    private boolean isWhitelistedStagedInstaller(String installerName) {
    private boolean isStagedInstallerAllowed(String installerName) {
        return SystemConfig.getInstance().getWhitelistedStagedInstallers().contains(installerName);
    }