Loading core/java/android/app/ActivityThread.java +11 −2 Original line number Diff line number Diff line Loading @@ -4919,18 +4919,27 @@ public final class ActivityThread { } void handleApplicationInfoChanged(@NonNull final ApplicationInfo ai) { // Updates triggered by package installation go through a package update // receiver. Here we try to capture ApplicationInfo changes that are // caused by other sources, such as overlays. That means we want to be as conservative // about code changes as possible. Take the diff of the old ApplicationInfo and the new // to see if anything needs to change. synchronized (mResourcesManager) { // Update all affected loaded packages with new package information WeakReference<LoadedApk> ref = mPackages.get(ai.packageName); LoadedApk apk = ref != null ? ref.get() : null; if (apk != null) { apk.updateApplicationInfo(ai, null); final ArrayList<String> oldPaths = new ArrayList<>(); LoadedApk.makePaths(this, apk.getApplicationInfo(), oldPaths, null /*outLibPaths*/); apk.updateApplicationInfo(ai, oldPaths); } ref = mResourcePackages.get(ai.packageName); apk = ref != null ? ref.get() : null; if (apk != null) { apk.updateApplicationInfo(ai, null); final ArrayList<String> oldPaths = new ArrayList<>(); LoadedApk.makePaths(this, apk.getApplicationInfo(), oldPaths, null /*outLibPaths*/); apk.updateApplicationInfo(ai, oldPaths); } // Update all affected Resources objects to use new ResourcesImpl Loading core/java/android/app/LoadedApk.java +11 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.app; import android.annotation.NonNull; import android.annotation.Nullable; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; Loading Loading @@ -262,7 +264,15 @@ public final class LoadedApk { return ai.sharedLibraryFiles; } public void updateApplicationInfo(ApplicationInfo aInfo, List<String> oldPaths) { /** * Update the ApplicationInfo for an app. If oldPaths is null, all the paths are considered * new. * @param aInfo The new ApplicationInfo to use for this LoadedApk * @param oldPaths The code paths for the old ApplicationInfo object. null means no paths can * be reused. */ public void updateApplicationInfo(@NonNull ApplicationInfo aInfo, @Nullable List<String> oldPaths) { setApplicationInfo(aInfo); final List<String> newPaths = new ArrayList<>(); Loading Loading
core/java/android/app/ActivityThread.java +11 −2 Original line number Diff line number Diff line Loading @@ -4919,18 +4919,27 @@ public final class ActivityThread { } void handleApplicationInfoChanged(@NonNull final ApplicationInfo ai) { // Updates triggered by package installation go through a package update // receiver. Here we try to capture ApplicationInfo changes that are // caused by other sources, such as overlays. That means we want to be as conservative // about code changes as possible. Take the diff of the old ApplicationInfo and the new // to see if anything needs to change. synchronized (mResourcesManager) { // Update all affected loaded packages with new package information WeakReference<LoadedApk> ref = mPackages.get(ai.packageName); LoadedApk apk = ref != null ? ref.get() : null; if (apk != null) { apk.updateApplicationInfo(ai, null); final ArrayList<String> oldPaths = new ArrayList<>(); LoadedApk.makePaths(this, apk.getApplicationInfo(), oldPaths, null /*outLibPaths*/); apk.updateApplicationInfo(ai, oldPaths); } ref = mResourcePackages.get(ai.packageName); apk = ref != null ? ref.get() : null; if (apk != null) { apk.updateApplicationInfo(ai, null); final ArrayList<String> oldPaths = new ArrayList<>(); LoadedApk.makePaths(this, apk.getApplicationInfo(), oldPaths, null /*outLibPaths*/); apk.updateApplicationInfo(ai, oldPaths); } // Update all affected Resources objects to use new ResourcesImpl Loading
core/java/android/app/LoadedApk.java +11 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.app; import android.annotation.NonNull; import android.annotation.Nullable; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; Loading Loading @@ -262,7 +264,15 @@ public final class LoadedApk { return ai.sharedLibraryFiles; } public void updateApplicationInfo(ApplicationInfo aInfo, List<String> oldPaths) { /** * Update the ApplicationInfo for an app. If oldPaths is null, all the paths are considered * new. * @param aInfo The new ApplicationInfo to use for this LoadedApk * @param oldPaths The code paths for the old ApplicationInfo object. null means no paths can * be reused. */ public void updateApplicationInfo(@NonNull ApplicationInfo aInfo, @Nullable List<String> oldPaths) { setApplicationInfo(aInfo); final List<String> newPaths = new ArrayList<>(); Loading