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

Commit 037fa248 authored by Christopher Tate's avatar Christopher Tate Committed by Android Git Automerger
Browse files

am d34e1155: am 5f474fcb: Merge "Edge case: overriden system package moved &...

am d34e1155: am 5f474fcb: Merge "Edge case: overriden system package moved & became privileged in OTA" into klp-dev

* commit 'd34e1155':
  Edge case: overriden system package moved & became privileged in OTA
parents 004aa071 d34e1155
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -3586,6 +3586,12 @@ public class PackageManagerService extends IPackageManager.Stub {
                                + " to " + scanFile);
                        updatedPkg.codePath = scanFile;
                        updatedPkg.codePathString = scanFile.toString();
                        // This is the point at which we know that the system-disk APK
                        // for this package has moved during a reboot (e.g. due to an OTA),
                        // so we need to reevaluate it for privilege policy.
                        if (locationIsPrivileged(scanFile)) {
                            updatedPkg.pkgFlags |= ApplicationInfo.FLAG_PRIVILEGED;
                        }
                    }
                    updatedPkg.pkg = pkg;
                    mLastScanError = PackageManager.INSTALL_FAILED_DUPLICATE_PACKAGE;
+6 −6
Original line number Diff line number Diff line
@@ -426,12 +426,12 @@ final class Settings {
                        + "; replacing with new");
                p = null;
            } else {
                if ((pkgFlags&ApplicationInfo.FLAG_SYSTEM) != 0) {
                    // If what we are scanning is a system package, then
                    // make it so, regardless of whether it was previously
                    // installed only in the data partition.
                    p.pkgFlags |= ApplicationInfo.FLAG_SYSTEM;
                }
                // If what we are scanning is a system (and possibly privileged) package,
                // then make it so, regardless of whether it was previously installed only
                // in the data partition.
                final int sysPrivFlags = pkgFlags
                        & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_PRIVILEGED);
                p.pkgFlags |= sysPrivFlags;
            }
        }
        if (p == null) {