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

Commit 79b121ea authored by Todd Kennedy's avatar Todd Kennedy
Browse files

also verify existence of a package

During an OTA, if a system app is replaced, keeping the same
directory but changing the package name, it's possible to have
a phantom disabled system package setting. In this scenario,
check that the disabled system package is actually backed by
a package.

Change-Id: Ifdaa3b3202256f3b039b0281ba6ab9d669d4b359
Fixes: 65367640
Test: Manual
Test: Create /system/app/Foo/Foo.apk
Test: upgrade app [adb install -r com.foo]
Test: Replace /system/app/Foo/Foo.apk w/ a new package name
parent d9abde75
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -2711,8 +2711,14 @@ public class PackageManagerService extends IPackageManager.Stub
                        // Actual deletion of code and data will be handled by later
                        // reconciliation step
                    } else {
                        final PackageSetting disabledPs = mSettings.getDisabledSystemPkgLPr(ps.name);
                        if (disabledPs.codePath == null || !disabledPs.codePath.exists()) {
                        // we still have a disabled system package, but, it still might have
                        // been removed. check the code path still exists and check there's
                        // still a package. the latter can happen if an OTA keeps the same
                        // code path, but, changes the package name.
                        final PackageSetting disabledPs =
                                mSettings.getDisabledSystemPkgLPr(ps.name);
                        if (disabledPs.codePath == null || !disabledPs.codePath.exists()
                                || disabledPs.pkg == null) {
                            possiblyDeletedUpdatedSystemApps.add(ps.name);
                        }
                    }