Fixing issue where dragging final items out of hot seat folder can causes inconsistency issue.

- Fixing restoring of workspace screens on rotation (and flash of custom content page indicator)
- Fixing NPE on long pressing on empty screen to go into overview mode
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 7fc7033..ce4a78c 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2537,14 +2537,16 @@
         boolean allowLongPress = isHotseatLayout(v) || mWorkspace.allowLongPress();
         if (allowLongPress && !mDragController.isDragging()) {
             if (itemUnderLongClick == null) {
-                // User long pressed on empty space
-                mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
-                        HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
-                // Disabling reordering until we sort out some issues.
-                if (mWorkspace.isInOverviewMode()) {
-                    mWorkspace.startReordering(v);
-                } else {
-                    mWorkspace.enterOverviewMode();
+                if (mWorkspace.hasNonCustomEmptyScreens()) {
+                    // User long pressed on empty space
+                    mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
+                            HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
+                    // Disabling reordering until we sort out some issues.
+                    if (mWorkspace.isInOverviewMode()) {
+                        mWorkspace.startReordering(v);
+                    } else {
+                        mWorkspace.enterOverviewMode();
+                    }
                 }
             } else {
                 if (!(itemUnderLongClick instanceof Folder)) {
@@ -3502,7 +3504,15 @@
     @Override
     public void bindScreens(ArrayList<Long> orderedScreenIds) {
         bindAddScreens(orderedScreenIds);
+
+        // Create the new empty page
         mWorkspace.addExtraEmptyScreen();
+
+        // Create the custom content page (this call updates mDefaultScreen which calls
+        // setCurrentPage() so ensure that all pages are added before calling this)
+        if (!mWorkspace.hasCustomContent() && hasCustomContentToLeft()) {
+            mWorkspace.createCustomContentPage();
+        }
     }
 
     @Override
@@ -3744,11 +3754,6 @@
             mSavedState = null;
         }
 
-        // Create the custom content page here before onLayout to prevent flashing
-        if (!mWorkspace.hasCustomContent() && hasCustomContentToLeft()) {
-            mWorkspace.createCustomContentPage();
-        }
-
         mWorkspace.restoreInstanceStateForRemainingPages();
 
         // If we received the result of any pending adds while the loader was running (e.g. the