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

Commit eca64b39 authored by Kenny Root's avatar Kenny Root
Browse files

Use removePackageLI instead of removing mPackages

When adding an system app via OTA, trying to remove it from mPackages
directly doesn't work. The ContentProviders and other things aren't
removed and point to the hidden system app's applicationInfo instead of
the updated app.

Bug: 6685263
Change-Id: I487cf518e0e3c60fae736e9b974617023a7dee8d
parent e9b4b3e9
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -1087,7 +1087,8 @@ public class PackageManagerService extends IPackageManager.Stub {
                    /*
                     * If the package is scanned, it's not erased.
                     */
                    if (mPackages.containsKey(ps.name)) {
                    final PackageParser.Package scannedPkg = mPackages.get(ps.name);
                    if (scannedPkg != null) {
                        /*
                         * If the system app is both scanned and in the
                         * disabled packages list, then it must have been
@@ -1096,7 +1097,9 @@ public class PackageManagerService extends IPackageManager.Stub {
                         * application can be scanned.
                         */
                        if (mSettings.isDisabledSystemPackageLPr(ps.name)) {
                            mPackages.remove(ps.name);
                            Slog.i(TAG, "Expecting better updatd system app for " + ps.name
                                    + "; removing system app");
                            removePackageLI(scannedPkg, true);
                        }

                        continue;
@@ -8626,6 +8629,10 @@ public class PackageManagerService extends IPackageManager.Stub {
                    }
                    pw.print("  ["); pw.print(entry.getKey()); pw.println("]:");
                    pw.print("    "); pw.println(p.toString());
                    if (p.info != null && p.info.applicationInfo != null) {
                        final String appInfo = p.info.applicationInfo.toString();
                        pw.print("      applicationInfo="); pw.println(appInfo);
                    }
                }
            }
            
+5 −0
Original line number Diff line number Diff line
@@ -2459,6 +2459,7 @@ final class Settings {
            pw.print("    nativeLibraryPath="); pw.println(ps.nativeLibraryPathString);
            pw.print("    versionCode="); pw.println(ps.versionCode);
            if (ps.pkg != null) {
                pw.print("    applicationInfo="); pw.println(ps.pkg.applicationInfo.toString());
                pw.print("    flags="); printFlags(pw, ps.pkg.applicationInfo.flags, FLAG_DUMP_SPEC); pw.println();
                pw.print("    versionName="); pw.println(ps.pkg.mVersionName);
                pw.print("    dataDir="); pw.println(ps.pkg.applicationInfo.dataDir);
@@ -2592,6 +2593,10 @@ final class Settings {
                    pw.print("    compat name=");
                    pw.println(ps.name);
                }
                if (ps.pkg != null && ps.pkg.applicationInfo != null) {
                    pw.print("    applicationInfo=");
                    pw.println(ps.pkg.applicationInfo.toString());
                }
                pw.print("    userId=");
                pw.println(ps.appId);
                pw.print("    sharedUser=");