Loading services/core/java/com/android/server/pm/PackageManagerService.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -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; Loading Loading @@ -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) { Loading Loading @@ -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(); Loading @@ -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 { Loading Loading
services/core/java/com/android/server/pm/PackageManagerService.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -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; Loading Loading @@ -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) { Loading Loading @@ -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(); Loading @@ -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 { Loading