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

Commit 327b1918 authored by Songchun Fan's avatar Songchun Fan
Browse files

[pm] remove mPm from InstallArgs

BUG: 238678399
Test: builds
Change-Id: I07ba1c3c0ecc2bdf8362dd475a20f8117a5fd3a2
parent 15f85c7f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -572,7 +572,7 @@ final class DeletePackageHelper {
        if (deleteCodeAndResources && (outInfo != null)) {
            outInfo.mArgs = new InstallArgs(
                    ps.getPathString(), getAppDexInstructionSets(
                            ps.getPrimaryCpuAbi(), ps.getSecondaryCpuAbi()), mPm);
                            ps.getPrimaryCpuAbi(), ps.getSecondaryCpuAbi()));
            if (DEBUG_SD_INSTALL) Slog.i(TAG, "args=" + outInfo.mArgs);
        }
    }
+4 −9
Original line number Diff line number Diff line
@@ -65,9 +65,6 @@ final class InstallArgs {
    // if we move dex files under the common app path.
    @Nullable String[] mInstructionSets;

    @NonNull final PackageManagerService mPm;
    @NonNull final RemovePackageHelper mRemovePackageHelper;

    InstallArgs(OriginInfo originInfo, MoveInfo moveInfo, IPackageInstallObserver2 observer,
            int installFlags, InstallSource installSource, String volumeUuid,
            UserHandle user, String[] instructionSets,
@@ -76,7 +73,7 @@ final class InstallArgs {
            int autoRevokePermissionsMode,
            String traceMethod, int traceCookie, SigningDetails signingDetails,
            int installReason, int installScenario, boolean forceQueryableOverride,
            int dataLoaderType, int packageSource, PackageManagerService pm) {
            int dataLoaderType, int packageSource) {
        mOriginInfo = originInfo;
        mMoveInfo = moveInfo;
        mInstallFlags = installFlags;
@@ -97,8 +94,6 @@ final class InstallArgs {
        mForceQueryableOverride = forceQueryableOverride;
        mDataLoaderType = dataLoaderType;
        mPackageSource = packageSource;
        mPm = pm;
        mRemovePackageHelper = new RemovePackageHelper(mPm);
    }

    /** New install */
@@ -110,19 +105,19 @@ final class InstallArgs {
                params.mAutoRevokePermissionsMode,
                params.mTraceMethod, params.mTraceCookie, params.mSigningDetails,
                params.mInstallReason, params.mInstallScenario, params.mForceQueryableOverride,
                params.mDataLoaderType, params.mPackageSource, params.mPm);
                params.mDataLoaderType, params.mPackageSource);
    }

    /**
     * Create args that describe an existing installed package. Typically used
     * when cleaning up old installs, or used as a move source.
     */
    InstallArgs(String codePath, String[] instructionSets, PackageManagerService pm) {
    InstallArgs(String codePath, String[] instructionSets) {
        this(OriginInfo.fromNothing(), null, null, 0, InstallSource.EMPTY,
                null, null, instructionSets, null, null, null, MODE_DEFAULT, null, 0,
                SigningDetails.UNKNOWN, PackageManager.INSTALL_REASON_UNKNOWN,
                PackageManager.INSTALL_SCENARIO_DEFAULT, false, DataLoaderType.NONE,
                PackageInstaller.PACKAGE_SOURCE_UNSPECIFIED, pm);
                PackageInstaller.PACKAGE_SOURCE_UNSPECIFIED);
        mCodeFile = (codePath != null) ? new File(codePath) : null;
    }

+3 −4
Original line number Diff line number Diff line
@@ -1938,7 +1938,7 @@ final class InstallPackageHelper {
                                        AndroidPackageUtils.getPrimaryCpuAbi(oldPackage,
                                                deletedPkgSetting),
                                        AndroidPackageUtils.getSecondaryCpuAbi(oldPackage,
                                                deletedPkgSetting)), mPm);
                                                deletedPkgSetting)));
                    } else {
                        res.mRemovedInfo.mArgs = null;
                    }
@@ -3938,7 +3938,7 @@ final class InstallPackageHelper {

            final InstallArgs args = new InstallArgs(
                    pkgSetting.getPathString(), getAppDexInstructionSets(
                    pkgSetting.getPrimaryCpuAbi(), pkgSetting.getSecondaryCpuAbi()), mPm);
                    pkgSetting.getPrimaryCpuAbi(), pkgSetting.getSecondaryCpuAbi()));
            mRemovePackageHelper.cleanUpResources(args);
            synchronized (mPm.mLock) {
                mPm.mSettings.enableSystemPackageLPw(pkgSetting.getPackageName());
@@ -4023,8 +4023,7 @@ final class InstallPackageHelper {
                                + parsedPackage.getPath());
                InstallArgs args = new InstallArgs(
                        pkgSetting.getPathString(), getAppDexInstructionSets(
                        pkgSetting.getPrimaryCpuAbi(), pkgSetting.getSecondaryCpuAbi()),
                        mPm);
                        pkgSetting.getPrimaryCpuAbi(), pkgSetting.getSecondaryCpuAbi()));
                mRemovePackageHelper.cleanUpResources(args);
            } else {
                // The application on /system is older than the application on /data. Hide