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

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

use directory timestamp during OTA am: 095d4125

am: 93660477

Change-Id: I7b94106395ccec00298a30f82447252e6252adb8
parents e489d3c0 93660477
Loading
Loading
Loading
Loading
+9 −2
Original line number Original line Diff line number Diff line
@@ -531,6 +531,7 @@ public class PackageManagerService extends IPackageManager.Stub {
    final String[] mSeparateProcesses;
    final String[] mSeparateProcesses;
    final boolean mIsUpgrade;
    final boolean mIsUpgrade;
    final boolean mIsPreNUpgrade;
    final boolean mIsPreNUpgrade;
    final boolean mIsPreNMR1Upgrade;
    /** The location for ASEC container files on internal storage. */
    /** The location for ASEC container files on internal storage. */
    final String mAsecInternalPath;
    final String mAsecInternalPath;
@@ -2238,6 +2239,8 @@ public class PackageManagerService extends IPackageManager.Stub {
            // as there is no profiling data available.
            // as there is no profiling data available.
            mIsPreNUpgrade = mIsUpgrade && ver.sdkVersion < Build.VERSION_CODES.N;
            mIsPreNUpgrade = mIsUpgrade && ver.sdkVersion < Build.VERSION_CODES.N;
            mIsPreNMR1Upgrade = mIsUpgrade && ver.sdkVersion < Build.VERSION_CODES.N_MR1;
            // save off the names of pre-existing system packages prior to scanning; we don't
            // save off the names of pre-existing system packages prior to scanning; we don't
            // want to automatically grant runtime permissions for new system apps
            // want to automatically grant runtime permissions for new system apps
            if (mPromoteSystemApps) {
            if (mPromoteSystemApps) {
@@ -6612,9 +6615,13 @@ public class PackageManagerService extends IPackageManager.Stub {
    private void collectCertificatesLI(PackageSetting ps, PackageParser.Package pkg, File srcFile,
    private void collectCertificatesLI(PackageSetting ps, PackageParser.Package pkg, File srcFile,
            final int policyFlags) throws PackageManagerException {
            final int policyFlags) throws PackageManagerException {
        // When upgrading from pre-N MR1, verify the package time stamp using the package
        // directory and not the APK file.
        final long lastModifiedTime = mIsPreNMR1Upgrade
                ? new File(pkg.codePath).lastModified() : getLastModifiedTime(pkg, srcFile);
        if (ps != null
        if (ps != null
                && ps.codePath.equals(srcFile)
                && ps.codePath.equals(srcFile)
                && ps.timeStamp == getLastModifiedTime(pkg, srcFile)
                && ps.timeStamp == lastModifiedTime
                && !isCompatSignatureUpdateNeeded(pkg)
                && !isCompatSignatureUpdateNeeded(pkg)
                && !isRecoverSignatureUpdateNeeded(pkg)) {
                && !isRecoverSignatureUpdateNeeded(pkg)) {
            long mSigningKeySetId = ps.keySetData.getProperSigningKeySet();
            long mSigningKeySetId = ps.keySetData.getProperSigningKeySet();
@@ -6636,7 +6643,7 @@ public class PackageManagerService extends IPackageManager.Stub {
            Slog.w(TAG, "PackageSetting for " + ps.name
            Slog.w(TAG, "PackageSetting for " + ps.name
                    + " is missing signatures.  Collecting certs again to recover them.");
                    + " is missing signatures.  Collecting certs again to recover them.");
        } else {
        } else {
            Log.i(TAG, srcFile.toString() + " changed; collecting certs");
            Slog.i(TAG, srcFile.toString() + " changed; collecting certs");
        }
        }
        try {
        try {