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
This commit is contained in:
Fengjiang Li
2023-07-18 13:53:01 -07:00
parent 210e000272
commit bafbdfbfd6

View File

@@ -585,6 +585,10 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
} 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();