Merge "Fix incorrect task index bounds" into ub-launcher3-qt-r1-dev
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
index 820a8df..596bc4f 100644
--- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
+++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java
@@ -165,8 +165,7 @@
}
if (FeatureFlags.PULL_DOWN_STATUS_BAR
- && !launcher.getDeviceProfile().isMultiWindowMode
- && !launcher.getDeviceProfile().isVerticalBarLayout()) {
+ && !launcher.getDeviceProfile().isMultiWindowMode) {
list.add(new StatusBarTouchController(launcher));
}
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityControllerHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityControllerHelper.java
index c43155b..8c5a788 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityControllerHelper.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityControllerHelper.java
@@ -80,7 +80,9 @@
@Override
public void onAssistantVisibilityChanged(float visibility) {
- // TODO:
+ // This class becomes active when the screen is locked.
+ // Rather than having it handle assistant visibility changes, the assistant visibility is
+ // set to zero prior to this class becoming active.
}
@NonNull
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
index 6f36b05..d7ed15c 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
@@ -723,7 +723,7 @@
return new OverviewInputConsumer(activity, mInputMonitorCompat,
false /* startingInActivityBounds */);
} else {
- return new OverviewWithoutFocusInputConsumer(this, mInputMonitorCompat,
+ return new OverviewWithoutFocusInputConsumer(activity, mInputMonitorCompat,
disableHorizontalSwipe(event));
}
}
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java
index 425b8b6..05cbb78 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewWithoutFocusInputConsumer.java
@@ -30,7 +30,13 @@
import android.view.VelocityTracker;
import android.view.ViewConfiguration;
+import com.android.launcher3.BaseActivity;
+import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.Utilities;
+import com.android.launcher3.logging.StatsLogUtils;
+import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
+import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
+import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
import com.android.quickstep.OverviewCallbacks;
import com.android.quickstep.util.NavBarPosition;
import com.android.systemui.shared.system.ActivityManagerWrapper;
@@ -131,12 +137,14 @@
? -velocityX : (mNavBarPosition.isLeftEdge() ? velocityX : -velocityY);
final boolean triggerQuickstep;
+ int touch = Touch.FLING;
if (Math.abs(velocity) >= ViewConfiguration.get(mContext).getScaledMinimumFlingVelocity()) {
triggerQuickstep = velocity > 0;
} else {
float displacementX = mDisableHorizontalSwipe ? 0 : (ev.getX() - mDownPos.x);
float displacementY = ev.getY() - mDownPos.y;
triggerQuickstep = squaredHypot(displacementX, displacementY) >= mSquaredTouchSlop;
+ touch = Touch.SWIPE;
}
if (triggerQuickstep) {
@@ -144,6 +152,13 @@
ActivityManagerWrapper.getInstance()
.closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS);
TOUCH_INTERACTION_LOG.addLog("startQuickstep");
+ BaseActivity activity = BaseDraggingActivity.fromContext(mContext);
+ int pageIndex = -1; // This number doesn't reflect workspace page index.
+ // It only indicates that launcher client screen was shown.
+ int containerType = StatsLogUtils.getContainerTypeFromState(activity.getCurrentState());
+ activity.getUserEventDispatcher().logActionOnContainer(
+ touch, Direction.UP, containerType, pageIndex);
+ activity.getUserEventDispatcher().setPreviousHomeGesture(true);
} else {
// ignore
}
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java
index f5ba372..11a8043 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java
@@ -33,6 +33,9 @@
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
+import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
+import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
+import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.util.TouchController;
import com.android.quickstep.RecentsModel;
import com.android.systemui.shared.recents.ISystemUiProxy;
@@ -132,8 +135,12 @@
@Override
public final boolean onControllerTouchEvent(MotionEvent ev) {
- if (ev.getAction() == ACTION_UP || ev.getAction() == ACTION_CANCEL) {
+ int action = ev.getAction();
+ if (action == ACTION_UP || action == ACTION_CANCEL) {
dispatchTouchEvent(ev);
+ mLauncher.getUserEventDispatcher().logActionOnContainer(action == ACTION_UP ?
+ Touch.FLING : Touch.SWIPE, Direction.DOWN, ContainerType.WORKSPACE,
+ mLauncher.getWorkspace().getCurrentPage());
setWindowSlippery(false);
return true;
}
diff --git a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
index 4a2ed3a..88a4eb6 100644
--- a/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
+++ b/quickstep/src/com/android/quickstep/OverviewComponentObserver.java
@@ -116,6 +116,14 @@
.getHomeActivities(new ArrayList<>());
mIsDefaultHome = Objects.equals(mMyHomeIntent.getComponent(), defaultHome);
+
+ // Set assistant visibility to 0 from launcher's perspective, ensures any elements that
+ // launcher made invisible become visible again before the new activity control helper
+ // becomes active.
+ if (mActivityControlHelper != null) {
+ mActivityControlHelper.onAssistantVisibilityChanged(0.f);
+ }
+
if ((mSystemUiStateFlags & SYSUI_STATE_HOME_DISABLED) == 0
&& (defaultHome == null || mIsDefaultHome)) {
// User default home is same as out home app. Use Overview integrated in Launcher.
@@ -131,6 +139,7 @@
}
} else {
// The default home app is a different launcher. Use the fallback Overview instead.
+
mActivityControlHelper = new FallbackActivityControllerHelper();
mIsHomeAndOverviewSame = false;
mOverviewIntent = mFallbackIntent;
diff --git a/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java b/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java
index b6cd1be..28a9707 100644
--- a/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java
+++ b/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java
@@ -102,6 +102,9 @@
if (mode == THREE_BUTTON || mode == ALL) {
evaluateWithThreeButtons();
}
+ } catch (Exception e) {
+ Log.e(TAG, "Exception", e);
+ throw e;
} finally {
setActiveOverlay(prevOverlayPkg, originalMode);
}
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 881f65d..339aef5 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -104,6 +104,7 @@
</style>
<style name="LauncherTheme.Dark.DarkText" parent="@style/LauncherTheme.Dark">
+ <item name="android:colorControlHighlight">#75212121</item>
<item name="allAppsInterimScrimAlpha">25</item>
<item name="folderFillColor">#CDFFFFFF</item>
<item name="folderTextColor">?attr/workspaceTextColor</item>
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 8cd0822..269a591 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -81,10 +81,10 @@
import com.android.launcher3.graphics.DragPreviewProvider;
import com.android.launcher3.graphics.PreloadIconDrawable;
import com.android.launcher3.graphics.RotationMode;
+import com.android.launcher3.logging.UserEventDispatcher;
import com.android.launcher3.pageindicators.WorkspacePageIndicator;
import com.android.launcher3.popup.PopupContainerWithArrow;
import com.android.launcher3.shortcuts.ShortcutDragPreviewProvider;
-import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.touch.WorkspaceTouchListener;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
@@ -1053,8 +1053,11 @@
// Not announcing the overlay page for accessibility since it announces itself.
} else if (Float.compare(scroll, 0f) == 0) {
if (mOverlayShown) {
- mLauncher.getUserEventDispatcher().logActionOnContainer(Action.Touch.SWIPE,
+ UserEventDispatcher ued = mLauncher.getUserEventDispatcher();
+ if (!ued.isPreviousHomeGesture()) {
+ mLauncher.getUserEventDispatcher().logActionOnContainer(Action.Touch.SWIPE,
Action.Direction.RIGHT, ContainerType.WORKSPACE, -1);
+ }
} else if (Float.compare(mOverlayTranslation, 0f) != 0) {
// When arriving to 0 overscroll from non-zero overscroll, announce page for
// accessibility since default announcements were disabled while in overscroll
diff --git a/src/com/android/launcher3/logging/StatsLogUtils.java b/src/com/android/launcher3/logging/StatsLogUtils.java
index 647f255..b02a050 100644
--- a/src/com/android/launcher3/logging/StatsLogUtils.java
+++ b/src/com/android/launcher3/logging/StatsLogUtils.java
@@ -1,9 +1,12 @@
package com.android.launcher3.logging;
+import static com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType.DEFAULT_CONTAINERTYPE;
+
import android.view.View;
import android.view.ViewParent;
import com.android.launcher3.ItemInfo;
+import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
import androidx.annotation.Nullable;
@@ -64,4 +67,20 @@
}
return null;
}
+
+ public static int getContainerTypeFromState(int state) {
+ int containerType = DEFAULT_CONTAINERTYPE;
+ switch (state) {
+ case StatsLogUtils.LAUNCHER_STATE_ALLAPPS:
+ containerType = ContainerType.ALLAPPS;
+ break;
+ case StatsLogUtils.LAUNCHER_STATE_HOME:
+ containerType = ContainerType.WORKSPACE;
+ break;
+ case StatsLogUtils.LAUNCHER_STATE_OVERVIEW:
+ containerType = ContainerType.OVERVIEW;
+ break;
+ }
+ return containerType;
+ }
}
diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java
index bd785a1..d81020e 100644
--- a/src/com/android/launcher3/logging/UserEventDispatcher.java
+++ b/src/com/android/launcher3/logging/UserEventDispatcher.java
@@ -115,6 +115,7 @@
protected InstantAppResolver mInstantAppResolver;
private boolean mAppOrTaskLaunch;
private UserEventDelegate mDelegate;
+ private boolean mPreviousHomeGesture;
// APP_ICON SHORTCUT WIDGET
// --------------------------------------------------------------
@@ -399,11 +400,22 @@
mElapsedContainerMillis = SystemClock.uptimeMillis();
}
+ public final void setPreviousHomeGesture(boolean homeGesture) {
+ mPreviousHomeGesture = homeGesture;
+ }
+
+ public final boolean isPreviousHomeGesture() {
+ return mPreviousHomeGesture;
+ }
+
public final void resetActionDurationMillis() {
mActionDurationMillis = SystemClock.uptimeMillis();
}
public void dispatchUserEvent(LauncherEvent ev, Intent intent) {
+ if (mPreviousHomeGesture) {
+ mPreviousHomeGesture = false;
+ }
mAppOrTaskLaunch = false;
ev.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis;
ev.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis;
@@ -426,6 +438,7 @@
ev.actionDurationMillis);
log += "\n\n";
Log.d(TAG, log);
+ return;
}
private static String getTargetsStr(Target[] targets) {
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index f91e2ad..fe7401c 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -331,8 +331,10 @@
final String systemHealth = getSystemHealthMessage();
if (systemHealth != null) {
- message = message + ", which might be a consequence of system health problems:\n<<<\n"
- + systemHealth + "\n>>>";
+ message = message
+ + ", which might be a consequence of system health "
+ + "problems:\n<<<<<<<<<<<<<<<<<<\n"
+ + systemHealth + "\n>>>>>>>>>>>>>>>>>>";
}
log("Hierarchy dump for: " + message);
diff --git a/tests/tapl/com/android/launcher3/tapl/TestHelpers.java b/tests/tapl/com/android/launcher3/tapl/TestHelpers.java
index ebe5eac..399c59d 100644
--- a/tests/tapl/com/android/launcher3/tapl/TestHelpers.java
+++ b/tests/tapl/com/android/launcher3/tapl/TestHelpers.java
@@ -109,6 +109,7 @@
DropBoxManager.Entry entry;
StringBuilder errorDetails = new StringBuilder();
while (null != (entry = dropbox.getNextEntry(label, timestamp))) {
+ if (errorDetails.length() != 0) errorDetails.append("------------------------------");
timestamp = entry.getTimeMillis();
errorDetails.append(new Date(timestamp));
errorDetails.append(": ");
@@ -135,7 +136,6 @@
"system_server_crash",
"system_server_native_crash",
"system_server_watchdog",
- "system_server_wtf",
};
for (String label : labels) {
@@ -143,7 +143,9 @@
if (crash != null) errors.append(crash);
}
- return errors.length() != 0 ? errors.toString() : null;
+ return errors.length() != 0
+ ? "Current time: " + new Date(System.currentTimeMillis()) + "\n" + errors
+ : null;
} catch (Exception e) {
return "Failed to get system health diags, maybe build your test via .bp instead of "
+ ".mk? " + android.util.Log.getStackTraceString(e);