From 411b71bf09cfa1d1b3d36fc0f744221c62d6573b Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Thu, 25 Nov 2021 10:31:31 -0600 Subject: [PATCH 1/6] TalkBack doesn't announce when a task has being closed. Adding announceForAccessibility() in createTaskDismissAnimation() to announce the task has being closed. Test: Manually tested Fix: 186744160 Change-Id: I71f57e7ba03a61b2ced7e338da4251637e89bd16 --- quickstep/res/values/strings.xml | 3 +++ quickstep/src/com/android/quickstep/views/RecentsView.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/quickstep/res/values/strings.xml b/quickstep/res/values/strings.xml index 151b8e4604..e10273c377 100644 --- a/quickstep/res/values/strings.xml +++ b/quickstep/res/values/strings.xml @@ -39,6 +39,9 @@ Recent apps + + Task Closed + %1$s, %2$s diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index c0658519dc..1c948ab82d 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -2740,6 +2740,8 @@ public abstract class RecentsView Date: Fri, 31 Dec 2021 15:21:23 +0000 Subject: [PATCH 2/6] Launch activity if click on a TaskView which has the task running on different display wit root. If click on the TaskView which has the task running on differnt display with root, it means we are trying to pull the task to the root display. So we should also launch the activity to the right display even it is in live tile mode. Also add null check for getRootViewDisplayId(). Bug: 207085426 Bug: 210075742 Test: manual test with app streaming wit phonehub notification Change-Id: Icdaa6dfa26345d271f3505a0226cf434696f40da --- quickstep/src/com/android/quickstep/views/TaskView.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index 1d8a45983b..c9cd31357d 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -16,6 +16,7 @@ package com.android.quickstep.views; +import static android.view.Display.DEFAULT_DISPLAY; import static android.widget.Toast.LENGTH_SHORT; import static com.android.launcher3.AbstractFloatingView.TYPE_TASK_MENU; @@ -51,6 +52,7 @@ import android.os.Bundle; import android.util.AttributeSet; import android.util.FloatProperty; import android.util.Log; +import android.view.Display; import android.view.MotionEvent; import android.view.TouchDelegate; import android.view.View; @@ -636,6 +638,7 @@ public class TaskView extends FrameLayout implements Reusable { // If the recents animation is cancelled somehow between the parent if block and // here, try to launch the task as a non live tile task. launchTaskAnimated(); + mIsClickableAsLiveTile = true; return; } @@ -657,6 +660,9 @@ public class TaskView extends FrameLayout implements Reusable { @Override public void onAnimationEnd(Animator animator) { + if (mTask != null && mTask.key.displayId != getRootViewDisplayId()) { + launchTaskAnimated(); + } mIsClickableAsLiveTile = true; } }); @@ -1517,7 +1523,8 @@ public class TaskView extends FrameLayout implements Reusable { private int getRootViewDisplayId() { - return getRootView().getDisplay().getDisplayId(); + Display display = getRootView().getDisplay(); + return display != null ? display.getDisplayId() : DEFAULT_DISPLAY; } /** From 08126d915c9d934eed269a073c8b5f7991367bf7 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 11 Jan 2022 20:06:16 +0000 Subject: [PATCH 3/6] Revert "Add logs for null task list" This reverts commit a46d36240b08e458fb25fb1231ed3ebd4a618c3a. Reason for revert: Reverting logs for release Change-Id: I65ae1ea691d5fb3d70a2db4beba08d7460b99e2b --- quickstep/src/com/android/quickstep/SystemUiProxy.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index a34343888d..67e7f88c33 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -34,7 +34,6 @@ import android.os.IBinder.DeathRecipient; import android.os.RemoteException; import android.os.UserHandle; import android.util.Log; -import android.util.Slog; import android.view.MotionEvent; import android.view.RemoteAnimationAdapter; import android.view.RemoteAnimationTarget; @@ -761,10 +760,8 @@ public class SystemUiProxy implements ISystemUiProxy, public ArrayList getRecentTasks(int numTasks, int userId) { if (mRecentTasks != null) { try { - final GroupedRecentTaskInfo[] tasks = mRecentTasks.getRecentTasks(numTasks, - RECENT_IGNORE_UNAVAILABLE, userId); - Log.d("b/206648922", "getRecentTasks(" + numTasks + "): result=" + tasks); - return new ArrayList<>(Arrays.asList(tasks)); + return new ArrayList<>(Arrays.asList(mRecentTasks.getRecentTasks(numTasks, + RECENT_IGNORE_UNAVAILABLE, userId))); } catch (RemoteException e) { Log.w(TAG, "Failed call getRecentTasks", e); } From 1ac72db930fe97297048b90a6845e37512762cf9 Mon Sep 17 00:00:00 2001 From: vadimt Date: Wed, 12 Jan 2022 10:34:23 -0800 Subject: [PATCH 4/6] Removing 2-button support from tests Bug: 187761685 Test: presubmit Change-Id: I932dd8cbc7524732e3ff83a35d7034b3e5ff75d9 --- .../quickstep/NavigationModeSwitchRule.java | 18 +---- .../StartLauncherViaGestureTests.java | 22 ------- .../android/launcher3/tapl/Background.java | 65 +++---------------- .../tapl/LauncherInstrumentation.java | 11 +--- 4 files changed, 13 insertions(+), 103 deletions(-) diff --git a/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java b/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java index 318f04eb01..1cb7529257 100644 --- a/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java +++ b/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java @@ -20,9 +20,7 @@ import static androidx.test.InstrumentationRegistry.getInstrumentation; import static com.android.quickstep.NavigationModeSwitchRule.Mode.ALL; import static com.android.quickstep.NavigationModeSwitchRule.Mode.THREE_BUTTON; -import static com.android.quickstep.NavigationModeSwitchRule.Mode.TWO_BUTTON; import static com.android.quickstep.NavigationModeSwitchRule.Mode.ZERO_BUTTON; -import static com.android.systemui.shared.system.QuickStepContract.NAV_BAR_MODE_2BUTTON_OVERLAY; import static com.android.systemui.shared.system.QuickStepContract.NAV_BAR_MODE_3BUTTON_OVERLAY; import static com.android.systemui.shared.system.QuickStepContract.NAV_BAR_MODE_GESTURAL_OVERLAY; @@ -61,7 +59,7 @@ public class NavigationModeSwitchRule implements TestRule { public static final int WAIT_TIME_MS = 10000; public enum Mode { - THREE_BUTTON, TWO_BUTTON, ZERO_BUTTON, ALL + THREE_BUTTON, ZERO_BUTTON, ALL } // Annotation for tests that need to be run with quickstep enabled and disabled. @@ -99,9 +97,6 @@ public class NavigationModeSwitchRule implements TestRule { if (mode == ZERO_BUTTON || mode == ALL) { evaluateWithZeroButtons(); } - if (mode == TWO_BUTTON || mode == ALL) { - evaluateWithTwoButtons(); - } if (mode == THREE_BUTTON || mode == ALL) { evaluateWithThreeButtons(); } @@ -123,13 +118,6 @@ public class NavigationModeSwitchRule implements TestRule { } } - private void evaluateWithTwoButtons() throws Throwable { - if (setActiveOverlay(mLauncher, NAV_BAR_MODE_2BUTTON_OVERLAY, - LauncherInstrumentation.NavigationModel.TWO_BUTTON, description)) { - base.evaluate(); - } - } - private void evaluateWithZeroButtons() throws Throwable { if (setActiveOverlay(mLauncher, NAV_BAR_MODE_GESTURAL_OVERLAY, LauncherInstrumentation.NavigationModel.ZERO_BUTTON, description)) { @@ -145,9 +133,7 @@ public class NavigationModeSwitchRule implements TestRule { public static String getCurrentOverlayPackage(int currentInteractionMode) { return QuickStepContract.isGesturalMode(currentInteractionMode) ? NAV_BAR_MODE_GESTURAL_OVERLAY - : QuickStepContract.isSwipeUpMode(currentInteractionMode) - ? NAV_BAR_MODE_2BUTTON_OVERLAY - : NAV_BAR_MODE_3BUTTON_OVERLAY; + : NAV_BAR_MODE_3BUTTON_OVERLAY; } private static LauncherInstrumentation.NavigationModel currentSysUiNavigationMode() { diff --git a/quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java b/quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java index f44a81275f..75d057ef80 100644 --- a/quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java +++ b/quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java @@ -16,23 +16,16 @@ package com.android.quickstep; -import static com.android.launcher3.util.RaceConditionReproducer.enterEvt; -import static com.android.launcher3.util.RaceConditionReproducer.exitEvt; - import android.content.Intent; import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; -import com.android.launcher3.Launcher; import com.android.launcher3.ui.TaplTestsLauncher3; import com.android.launcher3.util.RaceConditionReproducer; -import com.android.quickstep.NavigationModeSwitchRule.Mode; import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch; -import com.android.quickstep.inputconsumers.OtherActivityInputConsumer; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -65,21 +58,6 @@ public class StartLauncherViaGestureTests extends AbstractQuickStepTest { eventProcessor.finishIteration(); } - @Test - @Ignore // Ignoring until race condition repro framework is changes for multi-process case. - @NavigationModeSwitch(mode = Mode.TWO_BUTTON) - public void testPressHome() { - runTest(enterEvt(Launcher.ON_CREATE_EVT), - exitEvt(Launcher.ON_CREATE_EVT), - enterEvt(OtherActivityInputConsumer.DOWN_EVT), - exitEvt(OtherActivityInputConsumer.DOWN_EVT)); - - runTest(enterEvt(OtherActivityInputConsumer.DOWN_EVT), - exitEvt(OtherActivityInputConsumer.DOWN_EVT), - enterEvt(Launcher.ON_CREATE_EVT), - exitEvt(Launcher.ON_CREATE_EVT)); - } - @Test @NavigationModeSwitch public void testStressPressHome() { diff --git a/tests/tapl/com/android/launcher3/tapl/Background.java b/tests/tapl/com/android/launcher3/tapl/Background.java index 4eaecca9fb..d84d72392a 100644 --- a/tests/tapl/com/android/launcher3/tapl/Background.java +++ b/tests/tapl/com/android/launcher3/tapl/Background.java @@ -134,31 +134,6 @@ public class Background extends LauncherInstrumentation.VisibleContainer { break; } - case TWO_BUTTON: { - final int startX; - final int startY; - final int endX; - final int endY; - final int swipeLength = mLauncher.getTestInfo(getSwipeHeightRequestName()). - getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD) + mLauncher.getTouchSlop(); - - if (mLauncher.getDevice().isNaturalOrientation()) { - startX = endX = mLauncher.getDevice().getDisplayWidth() / 2; - startY = getSwipeStartY(); - endY = startY - swipeLength; - } else { - startX = getSwipeStartX(); - // TODO(b/184059820) make horizontal swipe use swipe width not height, for the - // moment just double the swipe length. - endX = startX - swipeLength * 2; - startY = endY = mLauncher.getDevice().getDisplayHeight() / 2; - } - - mLauncher.swipeToState(startX, startY, endX, endY, 10, OVERVIEW_STATE_ORDINAL, - LauncherInstrumentation.GestureScope.OUTSIDE_WITH_PILFER); - break; - } - case THREE_BUTTON: if (mLauncher.isTablet()) { mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, @@ -253,11 +228,7 @@ public class Background extends LauncherInstrumentation.VisibleContainer { "want to quick switch to the previous app")) { verifyActiveContainer(); final boolean launcherWasVisible = mLauncher.isLauncherVisible(); - boolean transposeInLandscape = false; switch (mLauncher.getNavigationModel()) { - case TWO_BUTTON: - transposeInLandscape = true; - // Fall through, zero button and two button modes behave the same. case ZERO_BUTTON: { final int startX; final int startY; @@ -265,33 +236,17 @@ public class Background extends LauncherInstrumentation.VisibleContainer { final int endY; final int cornerRadius = (int) Math.ceil(mLauncher.getWindowCornerRadius()); if (toRight) { - if (mLauncher.getDevice().isNaturalOrientation() || !transposeInLandscape) { - // Swipe from the bottom left to the bottom right of the screen. - startX = cornerRadius; - startY = getSwipeStartY(); - endX = mLauncher.getDevice().getDisplayWidth() - cornerRadius; - endY = startY; - } else { - // Swipe from the bottom right to the top right of the screen. - startX = getSwipeStartX(); - startY = mLauncher.getRealDisplaySize().y - 1 - cornerRadius; - endX = startX; - endY = cornerRadius; - } + // Swipe from the bottom left to the bottom right of the screen. + startX = cornerRadius; + startY = getSwipeStartY(); + endX = mLauncher.getDevice().getDisplayWidth() - cornerRadius; + endY = startY; } else { - if (mLauncher.getDevice().isNaturalOrientation() || !transposeInLandscape) { - // Swipe from the bottom right to the bottom left of the screen. - startX = mLauncher.getDevice().getDisplayWidth() - cornerRadius; - startY = getSwipeStartY(); - endX = cornerRadius; - endY = startY; - } else { - // Swipe from the bottom left to the top left of the screen. - startX = getSwipeStartX(); - startY = cornerRadius; - endX = startX; - endY = mLauncher.getRealDisplaySize().y - 1 - cornerRadius; - } + // Swipe from the bottom right to the bottom left of the screen. + startX = mLauncher.getDevice().getDisplayWidth() - cornerRadius; + startY = getSwipeStartY(); + endX = cornerRadius; + endY = startY; } final boolean isZeroButton = mLauncher.getNavigationModel() diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 46a7c71a02..f316a47981 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -124,7 +124,7 @@ public final class LauncherInstrumentation { WORKSPACE, ALL_APPS, OVERVIEW, WIDGETS, BACKGROUND, FALLBACK_OVERVIEW } - public enum NavigationModel {ZERO_BUTTON, TWO_BUTTON, THREE_BUTTON} + public enum NavigationModel {ZERO_BUTTON, THREE_BUTTON} // Where the gesture happens: outside of Launcher, inside or from inside to outside and // whether the gesture recognition triggers pilfer. @@ -391,8 +391,6 @@ public final class LauncherInstrumentation { public static NavigationModel getNavigationModel(int currentInteractionMode) { if (QuickStepContract.isGesturalMode(currentInteractionMode)) { return NavigationModel.ZERO_BUTTON; - } else if (QuickStepContract.isSwipeUpMode(currentInteractionMode)) { - return NavigationModel.TWO_BUTTON; } else if (QuickStepContract.isLegacyMode(currentInteractionMode)) { return NavigationModel.THREE_BUTTON; } @@ -873,10 +871,6 @@ public final class LauncherInstrumentation { log("Hierarchy before clicking home:"); dumpViewHierarchy(); action = "clicking home button"; - if (!isLauncher3() && getNavigationModel() == NavigationModel.TWO_BUTTON) { - expectEvent(TestProtocol.SEQUENCE_TIS, EVENT_TOUCH_DOWN_TIS); - expectEvent(TestProtocol.SEQUENCE_TIS, EVENT_TOUCH_UP_TIS); - } if (isTablet()) { expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_TOUCH_DOWN); expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_TOUCH_UP); @@ -917,9 +911,6 @@ public final class LauncherInstrumentation { if (isTablet()) { expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_TOUCH_DOWN); expectEvent(TestProtocol.SEQUENCE_MAIN, EVENT_TOUCH_UP); - } else if (!isLauncher3() && getNavigationModel() == NavigationModel.TWO_BUTTON) { - expectEvent(TestProtocol.SEQUENCE_TIS, EVENT_TOUCH_DOWN_TIS); - expectEvent(TestProtocol.SEQUENCE_TIS, EVENT_TOUCH_UP_TIS); } } if (launcherVisible) { From 03064a1e605d3d7cfc8d7f49655d50dfdf436bd8 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Wed, 12 Jan 2022 15:05:55 -0800 Subject: [PATCH 5/6] Directly assign mDepth A request to set a new depth is ignored if the surface is currently invalid. We should cache what was the requested value, so it will be applied once the surface is valid again. Test: manual Fixes: 209028986 Change-Id: I812816da4b0139c7ea7b53a9fb00f11265ecdea8 --- .../com/android/launcher3/statehandlers/DepthController.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java index e1d89a13dd..3242d42f93 100644 --- a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java +++ b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java @@ -289,9 +289,8 @@ public class DepthController implements StateHandler, if (Float.compare(mDepth, depthF) == 0) { return; } - if (dispatchTransactionSurface(depthF)) { - mDepth = depthF; - } + dispatchTransactionSurface(depthF); + mDepth = depthF; } public void onOverlayScrollChanged(float progress) { From a472190c8a3ab0a523947819da87cea45c6a346e Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Thu, 13 Jan 2022 22:08:40 +0000 Subject: [PATCH 6/6] Limit home gesture distance to half of screen height - Somehow when home gesture's travel distance is above certain number (~2560px in the bug's case), the touch will wrongly go to the 3P launcher instead of staying in quickstep launcehr only. As it's unusal for home gesture to be so long, limiting it to half of screen height. Bug: 214279686 Test: presbumit and TaplTestsLauncher3#testWidgets on cf_tablet Change-Id: I1107074556aea3011b186ba34dc830dbb1445517 --- .../com/android/launcher3/tapl/LauncherInstrumentation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index bc2afaf8c4..17d3a72232 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -864,7 +864,7 @@ public final class LauncherInstrumentation { swipeToState( displaySize.x / 2, displaySize.y - 1, - displaySize.x / 2, 0, + displaySize.x / 2, displaySize.y / 2, ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME, NORMAL_STATE_ORDINAL, gestureStartFromLauncher ? GestureScope.INSIDE_TO_OUTSIDE : GestureScope.OUTSIDE_WITH_PILFER);