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

Commit 5fe4cb1b authored by Torne (Richard Coles)'s avatar Torne (Richard Coles)
Browse files

Fix install and update times for non-system packages.

setInstallAndUpdateTime was only being called for system packages; move
the logic so it's called for non-system packages as well.

Bug: 124057711
Test: verify lastUpdateTime in pm dump before and after update
Change-Id: Ic15873c490ea23bdc1d5fc5d29657dd99e5b34d8
parent f6f2e32b
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -15859,6 +15859,12 @@ public class PackageManagerService extends IPackageManager.Stub
            if (reconciledPkg.prepareResult.replace) {
                PackageParser.Package oldPackage = mPackages.get(packageName);
                // Set the update and install times
                PackageSetting deletedPkgSetting = (PackageSetting) oldPackage.mExtras;
                setInstallAndUpdateTime(pkg, deletedPkgSetting.firstInstallTime,
                        System.currentTimeMillis());
                if (reconciledPkg.prepareResult.system) {
                    // Remove existing system package
                    removePackageLI(oldPackage, true);
@@ -15874,11 +15880,6 @@ public class PackageManagerService extends IPackageManager.Stub
                        res.removedInfo.args = null;
                    }
                    // Set the update and install times
                    PackageSetting deletedPkgSetting = (PackageSetting) oldPackage.mExtras;
                    setInstallAndUpdateTime(pkg, deletedPkgSetting.firstInstallTime,
                            System.currentTimeMillis());
                    // Update the package dynamic state if succeeded
                    // Now that the install succeeded make sure we remove data
                    // directories for any child package the update removed.