Only update entries if there is a change in expand / collapse state

Test: In all widgets tray, switch to work profile. Expands an app.
      Switch to personal tab and then switch back to work tab.
      The previously expanded app is collapsed with correct arrow.
Bug: 184199207
Change-Id: Iac601a04412cb8c5f163483c5dd79da35f1fd05c
diff --git a/src/com/android/launcher3/widget/picker/WidgetsListAdapter.java b/src/com/android/launcher3/widget/picker/WidgetsListAdapter.java
index d9c9d4d..0504e74 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsListAdapter.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsListAdapter.java
@@ -186,8 +186,10 @@
      * Resets any expanded widget header.
      */
     public void resetExpandedHeader() {
-        mWidgetsContentVisiblePackageUserKey = null;
-        updateVisibleEntries();
+        if (mWidgetsContentVisiblePackageUserKey != null) {
+            mWidgetsContentVisiblePackageUserKey = null;
+            updateVisibleEntries();
+        }
     }
 
     @Override