From cd1ef703502bdb1c3684bb6064dfa640c30abaf5 Mon Sep 17 00:00:00 2001 From: Schneider Victor-tulias Date: Mon, 4 Oct 2021 14:07:05 -0700 Subject: [PATCH 1/6] Update logging to help debug b/200572078 The class name logged in a repro of b/200572078 was shortened too much to find the class. Updated logging to get the full name. Test: ran launcher and checked logs Bug: 200572078 Change-Id: I12324348b4a8a56d4ab06ca54f13a90f8cbea955 --- src/com/android/launcher3/model/BaseLoaderResults.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/model/BaseLoaderResults.java b/src/com/android/launcher3/model/BaseLoaderResults.java index e9feb1cafd..3cae1e1e53 100644 --- a/src/com/android/launcher3/model/BaseLoaderResults.java +++ b/src/com/android/launcher3/model/BaseLoaderResults.java @@ -178,7 +178,7 @@ public abstract class BaseLoaderResults { Log.d(TestProtocol.NULL_INT_SET, "bind (1) currentScreenIds: " + currentScreenIds + ", mCallBacks: " - + mCallbacks.getClass().getSimpleName()); + + mCallbacks.getClass().getName()); } filterCurrentWorkspaceItems(currentScreenIds, mWorkspaceItems, currentWorkspaceItems, otherWorkspaceItems); From 37a5b5f5c2aea459f50b1a979e91861e31b26e68 Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Tue, 5 Oct 2021 03:50:22 +0000 Subject: [PATCH 2/6] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I089a6d4201294d7856fa6e60b03f89dcdc888b84 --- res/values-ky/strings.xml | 2 +- res/values-mr/strings.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/res/values-ky/strings.xml b/res/values-ky/strings.xml index c21a9418a2..e3836fed88 100644 --- a/res/values-ky/strings.xml +++ b/res/values-ky/strings.xml @@ -114,7 +114,7 @@ "Өчүк" "Эскертмелерге уруксат берилиши керек" "Эскертме белгилерин көрсөтүү максатында, %1$s үчүн колдонмонун билдирмелерин күйгүзүү керек" - "Жөндөөлөрдү өзгөртүү" + "Параметрлерди өзгөртүү" "Билдирмелер белгилерин көрсөтүү" "Колдонмонун сүрөтчөсүн Башкы экранга кошуу" "Жаңы колдонмолор үчүн" diff --git a/res/values-mr/strings.xml b/res/values-mr/strings.xml index 9e14926693..1b2d599f59 100644 --- a/res/values-mr/strings.xml +++ b/res/values-mr/strings.xml @@ -120,7 +120,7 @@ "नवीन अ‍ॅप्ससाठी" "अज्ञात" "काढा" - "Search" + "शोधा" "हा अ‍ॅप इंस्टॉल केलेला नाही" "या चिन्हासाठी अ‍ॅप इंस्टॉल केलेला नाही. तुम्ही ते काढू शकता किंवा अ‍ॅपचा शोध घेऊ शकता आणि त्यास व्यक्तिचलितपणे इंस्टॉल करू शकता." "%1$s इंस्टॉल करत आहे, %2$s पूर्ण झाले" From 516584e64844c673afe2f7913f89a7bbaee6a363 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Tue, 5 Oct 2021 17:21:48 +0100 Subject: [PATCH 3/6] Adjust min/max scroll according to mSplitPlaceholderSize - RTL is not handled yet due to split select broken Bug: 200537659 Test: Split left and split right, check if min/max scroll is correct Change-Id: I734d890bb955601da52cd806074014ed2e7eba55 --- .../android/quickstep/views/RecentsView.java | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index e1a389582f..74c8e395c7 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -409,7 +409,7 @@ public abstract class RecentsView 0) { + int minScroll; if (mIsRtl) { // If we aren't showing the clear all button, use the rightmost task as the min // scroll. - return getScrollForPage(mDisallowScrollToClearAll ? indexOfChild( + minScroll = getScrollForPage(mDisallowScrollToClearAll ? indexOfChild( getTaskViewAt(getTaskViewCount() - 1)) : indexOfChild(mClearAllButton)); + if (showAsGrid() && isSplitSelectionActive() + && mSplitSelectStateController.getActiveSplitStagePosition() + == SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT) { + minScroll -= mSplitPlaceholderSize; + } } else { TaskView focusedTaskView = mShowAsGridLastOnLayout ? getFocusedTaskView() : null; - return getScrollForPage(focusedTaskView != null ? indexOfChild(focusedTaskView) + minScroll = getScrollForPage(focusedTaskView != null ? indexOfChild(focusedTaskView) : 0); + // TODO(b/200537659): Adjust according to mSplitPlaceholderSize. } + return minScroll; } return super.computeMinScroll(); } @@ -4366,16 +4375,24 @@ public abstract class RecentsView 0) { + int maxScroll; if (mIsRtl) { TaskView focusedTaskView = mShowAsGridLastOnLayout ? getFocusedTaskView() : null; - return getScrollForPage(focusedTaskView != null ? indexOfChild(focusedTaskView) + maxScroll = getScrollForPage(focusedTaskView != null ? indexOfChild(focusedTaskView) : 0); + if (showAsGrid() && isSplitSelectionActive() + && mSplitSelectStateController.getActiveSplitStagePosition() + == SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT) { + maxScroll += mSplitPlaceholderSize; + } } else { // If we aren't showing the clear all button, use the leftmost task as the min // scroll. - return getScrollForPage(mDisallowScrollToClearAll ? indexOfChild( + maxScroll = getScrollForPage(mDisallowScrollToClearAll ? indexOfChild( getTaskViewAt(getTaskViewCount() - 1)) : indexOfChild(mClearAllButton)); + // TODO(b/200537659): Adjust according to mSplitPlaceholderSize. } + return maxScroll; } return super.computeMaxScroll(); } From 01e47343e6eda3ce15cffc79ee185ee9bbaeccda Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Thu, 30 Sep 2021 20:28:08 -0700 Subject: [PATCH 4/6] Set SurfaceTransactionApplier on non-stale RemoteAnimationTargets * When we create RemoteTargetHandles we create a new RemoteAnimationTarget from the old ones, which weren't getting their addReleaseCheck() methods called * The old recentsAnimationTargets were having it be set on them, however they go unused. Bug: 199043513 Change-Id: I36317f213139435ec09997290853787e30d11e0f --- .../com/android/quickstep/views/RecentsView.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index e1a389582f..4f46ab5007 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -4236,13 +4236,19 @@ public abstract class RecentsView remoteTargetHandle + .getTransformParams().getTargetSet() + .addReleaseCheck(mSyncTransactionApplier)); + } + TaskView runningTaskView = getRunningTaskView(); if (runningTaskView instanceof GroupedTaskView) { // We initially create a GroupedTaskView in showCurrentTask() before launcher even From a140a0b61109a6168ab25086d6d3e40e532e9678 Mon Sep 17 00:00:00 2001 From: Pat Manning Date: Thu, 30 Sep 2021 11:19:43 +0000 Subject: [PATCH 5/6] Add TAPL test that dismissing focused task causes next task to become focused. Test: TaplTestsQuickstep.java Bug: 197630182 Change-Id: I6f29dc6e3954f1b22ce8ffdf0a83db97202caefe --- .../QuickstepTestInformationHandler.java | 4 +- .../launcher3/testing/TestProtocol.java | 4 +- .../android/launcher3/tapl/BaseOverview.java | 22 ++++---- .../tapl/LauncherInstrumentation.java | 4 +- .../android/launcher3/tapl/OverviewTask.java | 52 ++++++++++++++----- 5 files changed, 55 insertions(+), 31 deletions(-) diff --git a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java index 12fba0dd61..6ccb152cbc 100644 --- a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java +++ b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java @@ -53,14 +53,14 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { Bundle::putInt, PortraitStatesTouchController::getHotseatTop); } - case TestProtocol.REQUEST_GET_FOCUSED_TASK_WIDTH_FOR_TABLET: { + case TestProtocol.REQUEST_GET_FOCUSED_TASK_HEIGHT_FOR_TABLET: { if (!mDeviceProfile.isTablet) { return null; } Rect focusedTaskRect = new Rect(); LauncherActivityInterface.INSTANCE.calculateTaskSize(mContext, mDeviceProfile, focusedTaskRect); - response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, focusedTaskRect.width()); + response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, focusedTaskRect.height()); return response; } } diff --git a/src/com/android/launcher3/testing/TestProtocol.java b/src/com/android/launcher3/testing/TestProtocol.java index ce01d4e5c6..f67bac6be5 100644 --- a/src/com/android/launcher3/testing/TestProtocol.java +++ b/src/com/android/launcher3/testing/TestProtocol.java @@ -102,8 +102,8 @@ public final class TestProtocol { public static final String REQUEST_GET_ACTIVITIES_CREATED_COUNT = "get-activities-created-count"; public static final String REQUEST_GET_ACTIVITIES = "get-activities"; - public static final String REQUEST_GET_FOCUSED_TASK_WIDTH_FOR_TABLET = - "get-focused-task-width-for-tablet"; + public static final String REQUEST_GET_FOCUSED_TASK_HEIGHT_FOR_TABLET = + "get-focused-task-height-for-tablet"; public static Long sForcePauseTimeout; public static final String REQUEST_SET_FORCE_PAUSE_TIMEOUT = "set-force-pause-timeout"; diff --git a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java index 7137c00b55..20366aae1f 100644 --- a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java +++ b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java @@ -138,6 +138,10 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { } } + int getTaskCount() { + return getTasks().size(); + } + /** * Returns whether Overview has tasks. */ @@ -169,7 +173,7 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { } try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( "want to assert overview actions view visibility")) { - if (mLauncher.isTablet() && !isOverviewSnappedToFocusedTask()) { + if (mLauncher.isTablet() && !isOverviewSnappedToFocusedTaskForTablet()) { mLauncher.waitUntilLauncherObjectGone("action_buttons"); } else { mLauncher.waitForLauncherObject("action_buttons"); @@ -178,14 +182,10 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { } /** - * Returns if focused task is currently snapped task in overview. + * Returns if focused task is currently snapped task in tablet grid overview. */ - private boolean isOverviewSnappedToFocusedTask() { - if (!mLauncher.isTablet()) { - // Focused task only exists in tablet's grid-overview - return false; - } - UiObject2 focusedTask = getFocusedTask(); + private boolean isOverviewSnappedToFocusedTaskForTablet() { + UiObject2 focusedTask = getFocusedTaskForTablet(); if (focusedTask == null) { return false; } @@ -197,14 +197,14 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { /** * Returns Overview focused task if it exists. */ - private UiObject2 getFocusedTask() { + UiObject2 getFocusedTaskForTablet() { final List taskViews = getTasks(); if (taskViews.size() == 0) { return null; } - int focusedTaskWidth = mLauncher.getFocusedTaskWidth(); + int focusedTaskHeight = mLauncher.getFocusedTaskHeightForTablet(); for (UiObject2 task : taskViews) { - if (task.getVisibleBounds().width() == focusedTaskWidth) { + if (task.getVisibleBounds().height() == focusedTaskHeight) { return task; } } diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index f83c031b89..55fb2c1ce3 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -321,8 +321,8 @@ public final class LauncherInstrumentation { .getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD); } - int getFocusedTaskWidth() { - return getTestInfo(TestProtocol.REQUEST_GET_FOCUSED_TASK_WIDTH_FOR_TABLET).getInt( + int getFocusedTaskHeightForTablet() { + return getTestInfo(TestProtocol.REQUEST_GET_FOCUSED_TASK_HEIGHT_FOR_TABLET).getInt( TestProtocol.TEST_INFO_RESPONSE_FIELD); } diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java index 71c0abb5a8..9419839d5d 100644 --- a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java +++ b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java @@ -47,29 +47,53 @@ public final class OverviewTask { mOverview.verifyActiveContainer(); } + private int getVisibleHeight() { + return mTask.getVisibleBounds().height(); + } + /** - * Swipes the task up. + * Dismisses the task by swiping up. */ public void dismiss() { try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck(); LauncherInstrumentation.Closable c = mLauncher.addContextLayer( - "want to dismiss a task")) { + "want to dismiss an overview task")) { verifyActiveContainer(); - // Dismiss the task via flinging it up. - final Rect taskBounds = mLauncher.getVisibleBounds(mTask); - final int centerX = taskBounds.centerX(); - final int centerY = taskBounds.centerY(); - mLauncher.executeAndWaitForLauncherEvent( - () -> mLauncher.linearGesture(centerX, centerY, centerX, 0, 10, false, - LauncherInstrumentation.GestureScope.INSIDE), - event -> TestProtocol.DISMISS_ANIMATION_ENDS_MESSAGE.equals( - event.getClassName()), - () -> "Didn't receive a dismiss animation ends message: " + centerX + ", " - + centerY, - "swiping to dismiss"); + int taskCountBeforeDismiss = mOverview.getTaskCount(); + mLauncher.assertNotEquals("Unable to find a task", 0, taskCountBeforeDismiss); + if (taskCountBeforeDismiss == 1) { + dismissBySwipingUp(); + return; + } + + boolean taskWasFocused = mLauncher.isTablet() && getVisibleHeight() == mLauncher + .getFocusedTaskHeightForTablet(); + + dismissBySwipingUp(); + + try (LauncherInstrumentation.Closable c2 = mLauncher.addContextLayer("dismissed")) { + if (taskWasFocused) { + mLauncher.assertNotNull("No task became focused", + mOverview.getFocusedTaskForTablet()); + } + } } } + private void dismissBySwipingUp() { + verifyActiveContainer(); + // Dismiss the task via flinging it up. + final Rect taskBounds = mLauncher.getVisibleBounds(mTask); + final int centerX = taskBounds.centerX(); + final int centerY = taskBounds.centerY(); + mLauncher.executeAndWaitForLauncherEvent( + () -> mLauncher.linearGesture(centerX, centerY, centerX, 0, 10, false, + LauncherInstrumentation.GestureScope.INSIDE), + event -> TestProtocol.DISMISS_ANIMATION_ENDS_MESSAGE.equals(event.getClassName()), + () -> "Didn't receive a dismiss animation ends message: " + centerX + ", " + + centerY, "swiping to dismiss"); + } + /** * Clicks at the task. */ From 05167371467a3800c8245a63476cae42be303662 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Tue, 5 Oct 2021 15:11:51 -0700 Subject: [PATCH 6/6] Reset state after split launch animation finishes Previously we were clearing SplitSelectStateController state too soon for fake landscape case where as soon as the tasks launch the device does a rotation animation since the new split tasks are in landscape. Move restting state after animation finishes. Fixes: 201980666 Change-Id: I23efd59fad444c47ae6c2048888a8570f22610fd --- .../quickstep/util/SplitSelectStateController.java | 7 ++----- .../src/com/android/quickstep/views/RecentsView.java | 8 +++++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java index e9a695d328..1dae2c8712 100644 --- a/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java +++ b/quickstep/src/com/android/quickstep/util/SplitSelectStateController.java @@ -163,10 +163,8 @@ public class SplitSelectStateController { if (mSuccessCallback != null) { mSuccessCallback.accept(true); } + resetState(); })); - - // After successful launch, call resetState - resetState(); } @Override @@ -175,9 +173,8 @@ public class SplitSelectStateController { if (mSuccessCallback != null) { mSuccessCallback.accept(false); } + resetState(); }); - - resetState(); } } diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index e1a389582f..e9c669bdfb 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -3918,7 +3918,6 @@ public abstract class RecentsView