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

Commit e83ab7fc authored by Todd Kennedy's avatar Todd Kennedy Committed by android-build-merger
Browse files

Merge "make sure package info is non-null" into oc-mr1-dev am: 63b3eff3

am: f7162448

Change-Id: Ifd73501b25b8487dd036abb56252feae6ef96d94
parents f7a051b9 f7162448
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import static com.android.server.pm.PackageInstallerService.prepareStageDir;

import android.Manifest;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.content.Intent;
@@ -737,7 +738,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
     *
     * @param pkgInfo The package info for {@link #params}.packagename
     */
    private void sealAndValidateLocked(PackageInfo pkgInfo)
    private void sealAndValidateLocked(@Nullable PackageInfo pkgInfo)
            throws PackageManagerException {
        assertNoWriteFileTransfersOpenLocked();

@@ -929,7 +930,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
     * Note that upgrade compatibility is still performed by
     * {@link PackageManagerService}.
     */
    private void validateInstallLocked(PackageInfo pkgInfo) throws PackageManagerException {
    private void validateInstallLocked(@Nullable PackageInfo pkgInfo)
            throws PackageManagerException {
        mPackageName = null;
        mVersionCode = -1;
        mSignatures = null;
@@ -1010,6 +1012,11 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
        }

        if (removeSplitList.size() > 0) {
            if (pkgInfo == null) {
                throw new PackageManagerException(INSTALL_FAILED_INVALID_APK,
                        "Missing existing base package for " + mPackageName);
            }

            // validate split names marked for removal
            for (String splitName : removeSplitList) {
                if (!ArrayUtils.contains(pkgInfo.splitNames, splitName)) {