From 9395830195eb593538411ba0c563d346b098a108 Mon Sep 17 00:00:00 2001 From: Luca Zuccarini Date: Thu, 9 Feb 2023 13:18:00 +0000 Subject: [PATCH] [Toast] Disable decorator updates if background drawables are used. These lines cause an NPE when using Toast after toggling the flag. Bug: 268470113 Test: manual Change-Id: I3b2b162cde37fe780580872e015672c0c9339e4f --- .../launcher3/allapps/ActivityAllAppsContainerView.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java index c3d24f995e..ef2a2da0cd 100644 --- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java @@ -439,9 +439,11 @@ public class ActivityAllAppsContainerView return; } - RecyclerView.ItemDecoration decoration = getMainAdapterProvider().getDecorator(); - getSearchRecyclerView().removeItemDecoration(decoration); - getSearchRecyclerView().addItemDecoration(decoration); + if (!FeatureFlags.ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES.get()) { + RecyclerView.ItemDecoration decoration = getMainAdapterProvider().getDecorator(); + getSearchRecyclerView().removeItemDecoration(decoration); + getSearchRecyclerView().addItemDecoration(decoration); + } // replaceAppsRVcontainer() needs to use both mUsingTabs value to remove the old view AND // showTabs value to create new view. Hence the mUsingTabs new value assignment MUST happen