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

Commit b703e1c6 authored by Patrick Baumann's avatar Patrick Baumann
Browse files

Recovers on boot when scan of data app fails

Prior to this change, system apps that had updated versions installed
that could not be scanned on boot, did not have a fallback mechanism to
restore the system app. With this change, we prepare for such a scenario
and restore the system app using the existing "expecting better"
mechanism.

Test: manual; muck with an APK in /data/app and reboot.
Bug: 117471712
Change-Id: Ic50880cc04e92003c2a20869cf38835af7ce3ccb
parent 10673d51
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2684,6 +2684,11 @@ public class PackageManagerService extends IPackageManager.Stub
                        if (disabledPs.codePath == null || !disabledPs.codePath.exists()
                                || disabledPs.pkg == null) {
                            possiblyDeletedUpdatedSystemApps.add(ps.name);
                        } else {
                            // We're expecting that the system app should remain disabled, but add
                            // it to expecting better to recover in case the data version cannot
                            // be scanned.
                            mExpectingBetter.put(disabledPs.name, disabledPs.codePath);
                        }
                    }
                }