Fixing regression, reset AllApps when the screen turns off.

- Now that we are debouncing the workspace state, we were no longer resetting
  the all apps view when the screen turns off when the user is already on the
  workspace.

Bug: 23759455
Change-Id: I996b595945de96ae6ff2344349027d4722921984
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 2873d37..7ad858c 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1614,7 +1614,10 @@
                 // processing a multi-step drop
                 if (mAppsView != null && mWidgetsView != null &&
                         mPendingAddInfo.container == ItemInfo.NO_ID) {
-                    showWorkspace(false);
+                    if (!showWorkspace(false)) {
+                        // If we are already on the workspace, then manually reset all apps
+                        mAppsView.reset();
+                    }
                 }
             } else if (Intent.ACTION_USER_PRESENT.equals(action)) {
                 mUserPresent = true;
@@ -3259,20 +3262,32 @@
         }
     }
 
-    public void showWorkspace(boolean animated) {
-        showWorkspace(WorkspaceStateTransitionAnimation.SCROLL_TO_CURRENT_PAGE, animated, null);
+    /**
+     * @return whether or not the Launcher state changed.
+     */
+    public boolean showWorkspace(boolean animated) {
+        return showWorkspace(WorkspaceStateTransitionAnimation.SCROLL_TO_CURRENT_PAGE, animated, null);
     }
 
-    public void showWorkspace(boolean animated, Runnable onCompleteRunnable) {
-        showWorkspace(WorkspaceStateTransitionAnimation.SCROLL_TO_CURRENT_PAGE, animated,
+    /**
+     * @return whether or not the Launcher state changed.
+     */
+    public boolean showWorkspace(boolean animated, Runnable onCompleteRunnable) {
+        return showWorkspace(WorkspaceStateTransitionAnimation.SCROLL_TO_CURRENT_PAGE, animated,
                 onCompleteRunnable);
     }
 
-    protected void showWorkspace(int snapToPage, boolean animated) {
-        showWorkspace(snapToPage, animated, null);
+    /**
+     * @return whether or not the Launcher state changed.
+     */
+    protected boolean showWorkspace(int snapToPage, boolean animated) {
+        return showWorkspace(snapToPage, animated, null);
     }
 
-    void showWorkspace(int snapToPage, boolean animated, Runnable onCompleteRunnable) {
+    /**
+     * @return whether or not the Launcher state changed.
+     */
+    boolean showWorkspace(int snapToPage, boolean animated, Runnable onCompleteRunnable) {
         boolean changed = mState != State.WORKSPACE ||
                 mWorkspace.getState() != Workspace.State.NORMAL;
         if (changed) {
@@ -3298,6 +3313,7 @@
             getWindow().getDecorView()
                     .sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
         }
+        return changed;
     }
 
     void showOverviewMode(boolean animated) {