Snap for 7514518 from 708b84a728a3a9fb712f911e6d7358b114aa34ab to sc-release

Change-Id: Ieff1255b8b64b800c5c971504fda68108369856e
diff --git a/src/com/android/wallpaper/picker/CustomizationPickerFragment.java b/src/com/android/wallpaper/picker/CustomizationPickerFragment.java
index 85232dd..d772ace 100644
--- a/src/com/android/wallpaper/picker/CustomizationPickerFragment.java
+++ b/src/com/android/wallpaper/picker/CustomizationPickerFragment.java
@@ -87,8 +87,15 @@
 
         initSections(savedInstanceState);
         mSectionControllers.forEach(controller ->
-                sectionContainer.addView(controller.createView(getContext())));
-        restoreViewState(savedInstanceState);
+                mNestedScrollView.post(() ->
+                        sectionContainer.addView(controller.createView(getContext()))
+                )
+        );
+        final Bundle savedInstanceStateRef = savedInstanceState;
+        // Post it to the end of adding views to ensure restoring view state the last task.
+        mNestedScrollView.post(() ->
+                restoreViewState(savedInstanceStateRef)
+        );
         return view;
     }