From bafbdfbfd6f151a6a8084aa50f85788012ed68b5 Mon Sep 17 00:00:00 2001 From: Fengjiang Li Date: Tue, 18 Jul 2023 13:53:01 -0700 Subject: [PATCH] Fix bug where all apps rv preinfaltion is not enabled when work profile is disabled When work profile is disabled, we should also let main RV use AllAppsStore's recycler view pool. Test: Turn off work profile, kill launcher process, swipe up all apps, start record perfetto trace, scroll down all apps, then stop record, verify no BubbleTextView inflation after change Bug: 287523421 Flags: ENABLE_ALL_APPS_RV_PREINFLATION Change-Id: Idd5f8193e85fc2a250877affc3b2e4ab4a704797 --- .../launcher3/allapps/ActivityAllAppsContainerView.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java index eb4ecaf161..251dc0261e 100644 --- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java @@ -585,6 +585,10 @@ public class ActivityAllAppsContainerView } else { mAH.get(AdapterHolder.MAIN).setup(findViewById(R.id.apps_list_view), null); mAH.get(AdapterHolder.WORK).mRecyclerView = null; + if (ENABLE_ALL_APPS_RV_PREINFLATION.get()) { + mAH.get(AdapterHolder.MAIN).mRecyclerView + .setRecycledViewPool(mAllAppsStore.getRecyclerViewPool()); + } } setupHeader();