Merge "On exit search in widget picker, make recommended widgets table visible only if recommended widgets are available." into sc-dev am: b89c991bab

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14234628

Change-Id: I9a0efdd27c3ce448589ca2756f28b5bafe5c41d9
diff --git a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
index 2bba316..bf1e8c2 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsFullSheet.java
@@ -435,8 +435,11 @@
 
     private void setViewVisibilityBasedOnSearch(boolean isInSearchMode) {
         mIsInSearchMode = isInSearchMode;
-        mSearchAndRecommendationViewHolder.mRecommendedWidgetsTable
-                .setVisibility(isInSearchMode ? GONE : VISIBLE);
+        if (isInSearchMode) {
+            mSearchAndRecommendationViewHolder.mRecommendedWidgetsTable.setVisibility(GONE);
+        } else {
+            onRecommendedWidgetsBound();
+        }
         if (mHasWorkProfile) {
             mViewPager.setVisibility(isInSearchMode ? GONE : VISIBLE);
             mTabsView.setVisibility(isInSearchMode ? GONE : VISIBLE);