All apps memory leak fix / unregister data observer

Bug: 197702957

Test: adb shell dumpsys meminfo com.google.android.apps.nexuslauncher, ahat

Change-Id: Ia5732cced959e4a199d9c2b59f1f3941a2e23552
This commit is contained in:
Hyunyoung Song
2021-08-25 02:04:09 -07:00
parent 6d7a006302
commit 6e72c8bbba
2 changed files with 17 additions and 7 deletions

View File

@@ -499,8 +499,10 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
private void replaceRVContainer(boolean showTabs) {
for (int i = 0; i < mAH.length; i++) {
if (mAH[i].recyclerView != null) {
mAH[i].recyclerView.setLayoutManager(null);
AllAppsRecyclerView rv = mAH[i].recyclerView;
if (rv != null) {
rv.setLayoutManager(null);
rv.setAdapter(null);
}
}
View oldView = getRecyclerViewContainer();