Ensuring that we reload a widget that was updated in another orientation.

Bug: 20044969
Change-Id: Iecdbe01d06c44653781ddef749e319f6b5b8afa1
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
index abed7a5..1377975 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
@@ -34,6 +34,7 @@
 import android.widget.FrameLayout;
 import com.android.systemui.R;
 import com.android.systemui.recents.Constants;
+import com.android.systemui.recents.RecentsAppWidgetHostView;
 import com.android.systemui.recents.RecentsConfiguration;
 import com.android.systemui.recents.misc.SystemServicesProxy;
 import com.android.systemui.recents.model.RecentsPackageMonitor;
@@ -69,7 +70,7 @@
 
     ArrayList<TaskStack> mStacks;
     List<TaskStackView> mTaskStackViews = new ArrayList<>();
-    View mSearchBar;
+    RecentsAppWidgetHostView mSearchBar;
     RecentsViewCallbacks mCb;
 
     public RecentsView(Context context) {
@@ -278,7 +279,7 @@
     }
 
     /** Adds the search bar */
-    public void setSearchBar(View searchBar) {
+    public void setSearchBar(RecentsAppWidgetHostView searchBar) {
         // Create the search bar (and hide it if we have no recent tasks)
         if (Constants.DebugFlags.App.EnableSearchLayout) {
             // Remove the previous search bar if one exists
@@ -294,8 +295,8 @@
     }
 
     /** Returns whether there is currently a search bar */
-    public boolean hasSearchBar() {
-        return mSearchBar != null;
+    public boolean hasValidSearchBar() {
+        return mSearchBar != null && !mSearchBar.isReinflateRequired();
     }
 
     /** Sets the visibility of the search bar */