Merge "Close system windows when starting the swipe up gesture." into ub-launcher3-master
diff --git a/quickstep/res/values/config.xml b/quickstep/res/values/config.xml
index 94211c6..37929b6 100644
--- a/quickstep/res/values/config.xml
+++ b/quickstep/res/values/config.xml
@@ -16,4 +16,5 @@
 <resources>
     <string name="task_overlay_factory_class" translatable="false"></string>
 
+    <string name="overview_callbacks_class" translatable="false"></string>
 </resources>
diff --git a/quickstep/src/com/android/launcher3/LauncherInitListener.java b/quickstep/src/com/android/launcher3/LauncherInitListener.java
index 27f1698..e5e377f 100644
--- a/quickstep/src/com/android/launcher3/LauncherInitListener.java
+++ b/quickstep/src/com/android/launcher3/LauncherInitListener.java
@@ -24,6 +24,7 @@
 
 import com.android.launcher3.states.InternalStateHandler;
 import com.android.quickstep.ActivityControlHelper.ActivityInitListener;
+import com.android.quickstep.OverviewCallbacks;
 import com.android.quickstep.util.RemoteAnimationProvider;
 
 import java.util.function.BiPredicate;
@@ -60,6 +61,7 @@
                 return null;
             });
         }
+        OverviewCallbacks.get(launcher).onInitOverviewTransition();
         return mOnInitListener.test(launcher, alreadyOnHome);
     }
 
diff --git a/quickstep/src/com/android/quickstep/OverviewCallbacks.java b/quickstep/src/com/android/quickstep/OverviewCallbacks.java
new file mode 100644
index 0000000..62938a7
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/OverviewCallbacks.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep;
+
+import android.content.Context;
+
+import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
+import com.android.launcher3.util.Preconditions;
+
+/**
+ * Callbacks related to overview/quicksteps.
+ */
+public class OverviewCallbacks {
+
+    private static OverviewCallbacks sInstance;
+
+    public static OverviewCallbacks get(Context context) {
+        Preconditions.assertUIThread();
+        if (sInstance == null) {
+            sInstance = Utilities.getOverrideObject(OverviewCallbacks.class,
+                    context.getApplicationContext(), R.string.overview_callbacks_class);
+        }
+        return sInstance;
+    }
+
+    public void onInitOverviewTransition() { }
+
+    public void onResetOverview() { }
+}
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index faaa40d..74e5959 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -64,6 +64,7 @@
 import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
 import com.android.launcher3.util.PendingAnimation;
 import com.android.launcher3.util.Themes;
+import com.android.quickstep.OverviewCallbacks;
 import com.android.quickstep.QuickScrubController;
 import com.android.quickstep.RecentsAnimationInterpolator;
 import com.android.quickstep.RecentsAnimationInterpolator.TaskWindowBounds;
@@ -513,6 +514,8 @@
         unloadVisibleTaskData();
         mRunningTaskId = -1;
         setCurrentPage(0);
+
+        OverviewCallbacks.get(getContext()).onResetOverview();
     }
 
     /**