Merge changes from topic "log-action-suggestion" into ub-launcher3-master
* changes:
[automerger] Refactors ButtonDropTarget to add extension data am: bda47cf925
Refactors ButtonDropTarget to add extension data
diff --git a/quickstep/libs/sysui_shared.jar b/quickstep/libs/sysui_shared.jar
index 70e545f..120d6f9 100644
--- a/quickstep/libs/sysui_shared.jar
+++ b/quickstep/libs/sysui_shared.jar
Binary files differ
diff --git a/quickstep/res/values/config.xml b/quickstep/res/values/config.xml
index 37929b6..7673f69 100644
--- a/quickstep/res/values/config.xml
+++ b/quickstep/res/values/config.xml
@@ -17,4 +17,6 @@
<string name="task_overlay_factory_class" translatable="false"></string>
<string name="overview_callbacks_class" translatable="false"></string>
+
+ <string name="user_event_dispatcher_class" translatable="false">com.google.quickstep.logging.UserEventDispatcherExtension</string>
</resources>
diff --git a/quickstep/src/com/android/quickstep/ActivityControlHelper.java b/quickstep/src/com/android/quickstep/ActivityControlHelper.java
index 8a6abb2..529a765 100644
--- a/quickstep/src/com/android/quickstep/ActivityControlHelper.java
+++ b/quickstep/src/com/android/quickstep/ActivityControlHelper.java
@@ -59,8 +59,6 @@
LayoutListener createLayoutListener(T activity);
- void onQuickstepGestureStarted(T activity, boolean activityVisible);
-
/**
* Updates the UI to indicate quick interaction.
* @return true if there any any UI change as a result of this
@@ -117,11 +115,6 @@
}
@Override
- public void onQuickstepGestureStarted(Launcher activity, boolean activityVisible) {
- activity.onQuickstepGestureStarted(activityVisible);
- }
-
- @Override
public boolean onQuickInteractionStart(Launcher activity, boolean activityVisible) {
LauncherState fromState = activity.getStateManager().getState();
activity.getStateManager().goToState(FAST_OVERVIEW, activityVisible);
@@ -137,10 +130,7 @@
@Override
public void executeOnWindowAvailable(Launcher activity, Runnable action) {
- if (activity.getWorkspace().runOnOverlayHidden(action)) {
- // Notify the activity that qiuckscrub has started
- onQuickstepGestureStarted(activity, true);
- }
+ activity.getWorkspace().runOnOverlayHidden(action);
}
@Override
@@ -310,11 +300,6 @@
class FallbackActivityControllerHelper implements ActivityControlHelper<RecentsActivity> {
@Override
- public void onQuickstepGestureStarted(RecentsActivity activity, boolean activityVisible) {
- // TODO:
- }
-
- @Override
public boolean onQuickInteractionStart(RecentsActivity activity, boolean activityVisible) {
// Activity does not need any UI change for quickscrub.
return false;
diff --git a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
index 6ce9372..2d41a5b 100644
--- a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
+++ b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
@@ -22,6 +22,8 @@
import static android.view.MotionEvent.ACTION_UP;
import static android.view.MotionEvent.INVALID_POINTER_ID;
+import static com.android.systemui.shared.system.ActivityManagerWrapper
+ .CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING;
import android.annotation.TargetApi;
@@ -73,6 +75,7 @@
private final ActivityControlHelper mActivityControlHelper;
private final MainThreadExecutor mMainThreadExecutor;
private final Choreographer mBackgroundThreadChoreographer;
+ private final OverviewCallbacks mOverviewCallbacks;
private final boolean mIsDeferredDownTarget;
private final PointF mDownPos = new PointF();
@@ -92,8 +95,10 @@
public OtherActivityTouchConsumer(Context base, RunningTaskInfo runningTaskInfo,
RecentsModel recentsModel, Intent homeIntent, ActivityControlHelper activityControl,
MainThreadExecutor mainThreadExecutor, Choreographer backgroundThreadChoreographer,
- @HitTarget int downHitTarget, VelocityTracker velocityTracker) {
+ @HitTarget int downHitTarget, OverviewCallbacks overviewCallbacks,
+ VelocityTracker velocityTracker) {
super(base);
+
mRunningTask = runningTaskInfo;
mRecentsModel = recentsModel;
mHomeIntent = homeIntent;
@@ -102,6 +107,7 @@
mMainThreadExecutor = mainThreadExecutor;
mBackgroundThreadChoreographer = backgroundThreadChoreographer;
mIsDeferredDownTarget = activityControl.deferStartingActivity(downHitTarget);
+ mOverviewCallbacks = overviewCallbacks;
}
@Override
@@ -187,6 +193,11 @@
if (mInteractionHandler == null) {
return;
}
+
+ mOverviewCallbacks.closeAllWindows();
+ ActivityManagerWrapper.getInstance().closeSystemWindows(
+ CLOSE_SYSTEM_WINDOWS_REASON_RECENTS);
+
// Notify the handler that the gesture has actually started
mInteractionHandler.onGestureStarted();
}
diff --git a/quickstep/src/com/android/quickstep/OverviewCallbacks.java b/quickstep/src/com/android/quickstep/OverviewCallbacks.java
index 62938a7..ac4a40b 100644
--- a/quickstep/src/com/android/quickstep/OverviewCallbacks.java
+++ b/quickstep/src/com/android/quickstep/OverviewCallbacks.java
@@ -40,4 +40,6 @@
public void onInitOverviewTransition() { }
public void onResetOverview() { }
+
+ public void closeAllWindows() { }
}
diff --git a/quickstep/src/com/android/quickstep/QuickScrubController.java b/quickstep/src/com/android/quickstep/QuickScrubController.java
index 7bb9877..adc245b 100644
--- a/quickstep/src/com/android/quickstep/QuickScrubController.java
+++ b/quickstep/src/com/android/quickstep/QuickScrubController.java
@@ -43,7 +43,7 @@
* Snap to a new page when crossing these thresholds. The first and last auto-advance.
*/
private static final float[] QUICK_SCRUB_THRESHOLDS = new float[] {
- 0.05f, 0.35f, 0.65f, 0.95f
+ 0.04f, 0.27f, 0.50f, 0.73f, 0.96f
};
private static final String TAG = "QuickScrubController";
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index c9afcb5..3babd1f 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -164,6 +164,7 @@
private ISystemUiProxy mISystemUiProxy;
private OverviewCommandHelper mOverviewCommandHelper;
private OverviewInteractionState mOverviewInteractionState;
+ private OverviewCallbacks mOverviewCallbacks;
private Choreographer mMainThreadChoreographer;
private Choreographer mBackgroundThreadChoreographer;
@@ -179,6 +180,7 @@
mMainThreadChoreographer = Choreographer.getInstance();
mEventQueue = new MotionEventQueue(mMainThreadChoreographer, mNoOpTouchConsumer);
mOverviewInteractionState = OverviewInteractionState.getInstance(this);
+ mOverviewCallbacks = OverviewCallbacks.get(this);
sConnected = true;
@@ -230,7 +232,8 @@
return new OtherActivityTouchConsumer(this, runningTaskInfo, mRecentsModel,
mOverviewCommandHelper.overviewIntent,
mOverviewCommandHelper.getActivityControlHelper(), mMainThreadExecutor,
- mBackgroundThreadChoreographer, downHitTarget, tracker);
+ mBackgroundThreadChoreographer, downHitTarget, mOverviewCallbacks,
+ tracker);
}
}
@@ -330,7 +333,7 @@
if (mInvalidated) {
return;
}
- mActivityHelper.onQuickstepGestureStarted(mActivity, true);
+ OverviewCallbacks.get(mActivity).closeAllWindows();
ActivityManagerWrapper.getInstance()
.closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS);
}
@@ -341,10 +344,11 @@
return;
}
if (interactionType == INTERACTION_QUICK_SCRUB) {
+ OverviewCallbacks.get(mActivity).closeAllWindows();
ActivityManagerWrapper.getInstance()
.closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS);
- mStartPending = true;
+ mStartPending = true;
Runnable action = () -> {
mQuickScrubController.onQuickScrubStart(mActivityHelper.onQuickInteractionStart(
mActivity, true), mActivityHelper);
diff --git a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
index 027f2e9..4e17b4b 100644
--- a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -24,7 +24,6 @@
import static com.android.quickstep.QuickScrubController.QUICK_SCRUB_START_DURATION;
import static com.android.quickstep.TouchConsumer.INTERACTION_NORMAL;
import static com.android.quickstep.TouchConsumer.INTERACTION_QUICK_SCRUB;
-import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import android.animation.Animator;
import android.animation.ObjectAnimator;
@@ -69,7 +68,6 @@
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.ThumbnailData;
-import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.InputConsumerController;
import com.android.systemui.shared.system.LatencyTrackerCompat;
import com.android.systemui.shared.system.RecentsAnimationControllerCompat;
@@ -564,8 +562,6 @@
mGestureStarted = true;
mRecentsAnimationWrapper.hideCurrentInputMethod();
mRecentsAnimationWrapper.enableInputConsumer();
- ActivityManagerWrapper.getInstance().closeSystemWindows(
- CLOSE_SYSTEM_WINDOWS_REASON_RECENTS);
}
/**
@@ -579,8 +575,6 @@
// Once the gesture starts, we can no longer transition home through the button, so
// reset the force override of the activity visibility
mActivity.clearForceInvisibleFlag(INVISIBLE_BY_STATE_HANDLER);
- mActivityControlHelper.onQuickstepGestureStarted(
- curActivity, mWasLauncherAlreadyVisible);
}
}
diff --git a/quickstep/src/com/android/quickstep/logging/UserEventDispatcherExtension.java b/quickstep/src/com/android/quickstep/logging/UserEventDispatcherExtension.java
new file mode 100644
index 0000000..d4cdd35
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/logging/UserEventDispatcherExtension.java
@@ -0,0 +1,35 @@
+/*
+ * 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.logging;
+
+import com.android.launcher3.logging.UserEventDispatcher;
+import com.android.launcher3.userevent.nano.LauncherLogProto;
+import com.android.systemui.shared.system.MetricsLoggerCompat;
+
+/**
+ * This class handles AOSP MetricsLogger function calls.
+ */
+public class UserEventDispatcherExtension extends UserEventDispatcher {
+
+ public void logStateChangeAction(int action, int dir, int srcChildTargetType,
+ int srcParentContainerType, int dstContainerType,
+ int pageIndex) {
+ new MetricsLoggerCompat().visibility(MetricsLoggerCompat.OVERVIEW_ACTIVITY,
+ dstContainerType == LauncherLogProto.ContainerType.TASKSWITCHER);
+ super.logStateChangeAction(action, dir, srcChildTargetType, srcParentContainerType,
+ dstContainerType, pageIndex);
+ }
+}
diff --git a/quickstep/src/com/android/quickstep/views/ClearAllButton.java b/quickstep/src/com/android/quickstep/views/ClearAllButton.java
index 14867ab..f3a0e4f 100644
--- a/quickstep/src/com/android/quickstep/views/ClearAllButton.java
+++ b/quickstep/src/com/android/quickstep/views/ClearAllButton.java
@@ -23,9 +23,9 @@
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.accessibility.AccessibilityNodeInfo;
-import android.widget.TextView;
+import android.widget.Button;
-public class ClearAllButton extends TextView {
+public class ClearAllButton extends Button {
RecentsView mRecentsView;
public ClearAllButton(Context context, @Nullable AttributeSet attrs) {
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index db817e7..9a9e001 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1155,12 +1155,6 @@
}
}
- public void onQuickstepGestureStarted(boolean isVisible) {
- if (mLauncherCallbacks != null) {
- mLauncherCallbacks.onQuickstepGestureStarted(isVisible);
- }
- }
-
public AllAppsTransitionController getAllAppsController() {
return mAllAppsController;
}
diff --git a/src/com/android/launcher3/LauncherCallbacks.java b/src/com/android/launcher3/LauncherCallbacks.java
index 6aef658..34bdb3c 100644
--- a/src/com/android/launcher3/LauncherCallbacks.java
+++ b/src/com/android/launcher3/LauncherCallbacks.java
@@ -18,7 +18,6 @@
import android.content.Intent;
import android.os.Bundle;
-import android.view.Menu;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -70,12 +69,4 @@
* Extensions points for adding / replacing some other aspects of the Launcher experience.
*/
boolean hasSettings();
-
- /**
- * Called when launcher integrated quickstep and some quickstep gesture started. It can be
- * called multiple times for a single gesture an UI or background thread.
- *
- * @param isVisible if Launcher was visible when the gesture started.
- */
- void onQuickstepGestureStarted(boolean isVisible);
}
diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java
index bf870cc..2c1eb32 100644
--- a/src/com/android/launcher3/logging/UserEventDispatcher.java
+++ b/src/com/android/launcher3/logging/UserEventDispatcher.java
@@ -285,7 +285,7 @@
* Used primarily for swipe up and down when state changes when swipe up happens from the
* navbar bezel, the {@param srcChildContainerType} is NAVBAR and
* {@param srcParentContainerType} is either one of the two
- * (1) WORKSPACE: if the launcher the foreground activity
+ * (1) WORKSPACE: if the launcher is the foreground activity
* (2) APP: if another app was the foreground activity
*/
public void logStateChangeAction(int action, int dir, int srcChildTargetType,