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

Commit 773e9974 authored by Fyodor Kupolov's avatar Fyodor Kupolov
Browse files

Cache package names after reboot

In case of a reboot mApkToPackageMap becomes empty, but packages can still
be installed in user 0. We need to repopulate the cache again.

Bug: 30280710
Change-Id: Ia18e93c351b5af80de434e8c5311b961b314a9fb
parent 51ce8ee3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -130,6 +130,10 @@ class PreloadAppsInstaller {
                    // Install on user 0 so that the package is cached when demo user is re-created
                    installExistingPackage(basePackageName, UserHandle.USER_SYSTEM, counter);
                } else if (returnCode == PackageManager.INSTALL_FAILED_ALREADY_EXISTS) {
                    // This can only happen in first session after a reboot
                    if (!mApkToPackageMap.containsKey(apkName)) {
                        mApkToPackageMap.put(apkName, basePackageName);
                    }
                    installExistingPackage(basePackageName, userId, counter);
                }
            }