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

Commit 1fd46de2 authored by Calin Juravle's avatar Calin Juravle Committed by Android (Google) Code Review
Browse files

Merge "Check for a null packageInfo before notifying about app install" into oc-dev

parents ecb5b5cc 72bb1c61
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -1915,9 +1915,13 @@ public class PackageManagerService extends IPackageManager.Stub {
            // survive long enough to benefit of background optimizations.
            // survive long enough to benefit of background optimizations.
            for (int userId : firstUsers) {
            for (int userId : firstUsers) {
                PackageInfo info = getPackageInfo(packageName, /*flags*/ 0, userId);
                PackageInfo info = getPackageInfo(packageName, /*flags*/ 0, userId);
                // There's a race currently where some install events may interleave with an uninstall.
                // This can lead to package info being null (b/36642664).
                if (info != null) {
                    mDexManager.notifyPackageInstalled(info, userId);
                    mDexManager.notifyPackageInstalled(info, userId);
                }
                }
            }
            }
        }
        // If someone is watching installs - notify them
        // If someone is watching installs - notify them
        if (installObserver != null) {
        if (installObserver != null) {