Force config update when twoline is toggled.

Based on the bug, it seems that onHandleConfigChange was not called via the perfetto trace. Here is the call order:
1) Loader Task is created
2) Loader task runs
3) Preinflation happens from setApps() in bindAllApplications() via ModelCallbacks.kt
4) When show long app names toggle happens: it eventually triggers an onHandleConfigurationChanged() which is traceable in perfetto.
5) After configChange, preinflation happens again.

In step 4) there is an early return that happens and makes it so it doesn't call the reinflation of views that happens in the mModel.rebindCallbacks().
When the force configUpdate happens upon toggle, reset the variable after it is done.

bug: 370121944
Test: presubmit/manually/perfetto in bug
Flag: NONE trying to fix edge case
Change-Id: Id0ba591bfe583b300cc241fcfc37db6dd5a85363
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index b0ec9b0..30f9e29 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -412,6 +412,7 @@
 
     private final List<BackPressHandler> mBackPressedHandlers = new ArrayList<>();
     private boolean mIsColdStartupAfterReboot;
+    private boolean mForceConfigUpdate;
 
     private boolean mIsNaturalScrollingEnabled;
 
@@ -756,7 +757,7 @@
     protected void onHandleConfigurationChanged() {
         Trace.beginSection("Launcher#onHandleconfigurationChanged");
         try {
-            if (!initDeviceProfile(mDeviceProfile.inv)) {
+            if (!initDeviceProfile(mDeviceProfile.inv) && !mForceConfigUpdate) {
                 return;
             }
 
@@ -770,6 +771,7 @@
             mModel.rebindCallbacks();
             updateDisallowBack();
         } finally {
+            mForceConfigUpdate = false;
             Trace.endSection();
         }
     }
@@ -3146,6 +3148,13 @@
         return mAnimationCoordinator;
     }
 
+    /**
+     * Set to force config update when set to true next time onHandleConfigurationChanged is called.
+     */
+    public void setForceConfigUpdate(boolean forceConfigUpdate) {
+        mForceConfigUpdate = forceConfigUpdate;
+    }
+
     @Override
     public View.OnLongClickListener getAllAppsItemLongClickListener() {
         return ItemLongClickListener.INSTANCE_ALL_APPS;