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

Commit c91fd211 authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Don't crash in case of race condition.

Bug: 310102144
Test: presubmit, observe crash trend
Change-Id: I4d397e5350dec32ca13a297747e662057cbf3bac
parent c114177f
Loading
Loading
Loading
Loading
+13 −12
Original line number Diff line number Diff line
@@ -6834,6 +6834,7 @@ public final class ActivityThread extends ClientTransactionHandler
                                                PackageManager.GET_SHARED_LIBRARY_FILES,
                                                UserHandle.myUserId());

                                if (aInfo != null) {
                                    if (mActivities.size() > 0) {
                                        for (ActivityClientRecord ar : mActivities.values()) {
                                            if (ar.activityInfo.applicationInfo.packageName
@@ -6847,10 +6848,10 @@ public final class ActivityThread extends ClientTransactionHandler
                                    final String[] oldResDirs = {pkgInfo.getResDir()};

                                    final ArrayList<String> oldPaths = new ArrayList<>();
                                LoadedApk.makePaths(this, pkgInfo.getApplicationInfo(), oldPaths);
                                    LoadedApk.makePaths(
                                            this, pkgInfo.getApplicationInfo(), oldPaths);
                                    pkgInfo.updateApplicationInfo(aInfo, oldPaths);

                                synchronized (mResourcesManager) {
                                    // Update affected Resources objects to use new ResourcesImpl
                                    mResourcesManager.appendPendingAppInfoUpdate(oldResDirs,
                                            aInfo);