Merge "Update folder pagination dot color to match mocks." into sc-v2-dev
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index 6249e6a..42c89fd 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -1534,7 +1534,9 @@
boolean wasVisible = mWasLauncherAlreadyVisible || mGestureStarted;
mActivityInterface.onTransitionCancelled(wasVisible, mGestureState.getEndTarget());
- TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, true);
+ if (mRecentsAnimationTargets != null) {
+ TaskViewUtils.setDividerBarShown(mRecentsAnimationTargets.nonApps, true);
+ }
// Leave the pending invisible flag, as it may be used by wallpaper open animation.
if (mActivity != null) {
diff --git a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
index 080533b..f49c9b0 100644
--- a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
+++ b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java
@@ -183,6 +183,13 @@
}
/**
+ * Called when the current task's thumbnail has changed.
+ */
+ public void refreshActionVisibility(ThumbnailData thumbnail) {
+ getActionsView().updateDisabledFlags(DISABLED_NO_THUMBNAIL, thumbnail == null);
+ }
+
+ /**
* End rendering live tile in Overview.
*
* @param callback callback to run, after switching to screenshot
diff --git a/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java b/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java
index ac2534e..65be624 100644
--- a/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java
+++ b/quickstep/src/com/android/quickstep/util/MotionPauseDetector.java
@@ -17,6 +17,7 @@
import android.content.Context;
import android.content.res.Resources;
+import android.util.Log;
import android.view.MotionEvent;
import android.view.VelocityTracker;
@@ -85,7 +86,12 @@
mSpeedSomewhatFast = res.getDimension(R.dimen.motion_pause_detector_speed_somewhat_fast);
mSpeedFast = res.getDimension(R.dimen.motion_pause_detector_speed_fast);
mForcePauseTimeout = new Alarm();
- mForcePauseTimeout.setOnAlarmListener(alarm -> updatePaused(true /* isPaused */));
+ mForcePauseTimeout.setOnAlarmListener(alarm -> {
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.MOTION_PAUSE_TIMEOUT, "onAlarm");
+ }
+ updatePaused(true /* isPaused */);
+ });
mMakePauseHarderToTrigger = makePauseHarderToTrigger;
mVelocityProvider = new SystemVelocityProvider(axis);
}
@@ -119,9 +125,13 @@
* @param pointerIndex Index for the pointer being tracked in the motion event
*/
public void addPosition(MotionEvent ev, int pointerIndex) {
- mForcePauseTimeout.setAlarm(TestProtocol.sForcePauseTimeout != null
+ long timeoutMs = TestProtocol.sForcePauseTimeout != null
? TestProtocol.sForcePauseTimeout
- : mMakePauseHarderToTrigger ? HARDER_TRIGGER_TIMEOUT : FORCE_PAUSE_TIMEOUT);
+ : mMakePauseHarderToTrigger ? HARDER_TRIGGER_TIMEOUT : FORCE_PAUSE_TIMEOUT;
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.MOTION_PAUSE_TIMEOUT, "setAlarm: " + timeoutMs);
+ }
+ mForcePauseTimeout.setAlarm(timeoutMs);
float newVelocity = mVelocityProvider.addMotionEvent(ev, ev.getPointerId(pointerIndex));
if (mPreviousVelocity != null) {
checkMotionPaused(newVelocity, mPreviousVelocity, ev.getEventTime());
@@ -162,6 +172,9 @@
}
}
}
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.MOTION_PAUSE_TIMEOUT, "checkMotionPaused: " + isPaused);
+ }
updatePaused(isPaused);
}
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index b077ca6..935305a 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -42,6 +42,7 @@
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_DISMISS_SWIPE_UP;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_LAUNCH_SWIPE_DOWN;
import static com.android.launcher3.statehandlers.DepthController.DEPTH;
+import static com.android.launcher3.testing.TestProtocol.TASK_VIEW_ID_CRASH;
import static com.android.launcher3.touch.PagedOrientationHandler.CANVAS_TRANSLATE;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
@@ -82,6 +83,7 @@
import android.text.TextPaint;
import android.util.AttributeSet;
import android.util.FloatProperty;
+import android.util.Log;
import android.util.SparseBooleanArray;
import android.view.HapticFeedbackConstants;
import android.view.KeyEvent;
@@ -1222,6 +1224,9 @@
// TODO set these type to array and check all taskIDs? Maybe we can get away w/ only one
int runningTaskId = getTaskIdsForTaskViewId(mRunningTaskViewId)[0];
int focusedTaskId = getTaskIdsForTaskViewId(mFocusedTaskViewId)[0];
+ Log.d(TASK_VIEW_ID_CRASH, "runningTaskId beforeBind: " + runningTaskId
+ + " runningTaskViewId: " + mRunningTaskViewId
+ + " forTaskView: " + getTaskViewFromTaskViewId(mRunningTaskViewId));
// Rebind and reset all task views
for (int i = requiredTaskCount - 1; i >= 0; i--) {
@@ -1246,6 +1251,18 @@
// Update mRunningTaskViewId to be the new TaskView that was assigned by binding
// the full list of tasks to taskViews
newRunningTaskView = getTaskViewByTaskId(runningTaskId);
+ if (newRunningTaskView == null) {
+ StringBuilder sb = new StringBuilder();
+ for (int i = requiredTaskCount - 1; i >= 0; i--) {
+ final int pageIndex = requiredTaskCount - i - 1 + mTaskViewStartIndex;
+ final TaskView taskView = (TaskView) getChildAt(pageIndex);
+ int taskViewId = taskView.getTaskViewId();
+ sb.append(" taskViewId: " + taskViewId
+ + " taskId: " + getTaskIdsForTaskViewId(taskViewId)[0]
+ + " for taskView: " + taskView + "\n");
+ }
+ Log.d(TASK_VIEW_ID_CRASH, sb.toString());
+ }
mRunningTaskViewId = newRunningTaskView.getTaskViewId();
}
diff --git a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java
index 320ea09..35e21ad 100644
--- a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java
@@ -162,7 +162,9 @@
mBitmapShader = new BitmapShader(bm, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
mPaint.setShader(mBitmapShader);
updateThumbnailMatrix();
- refreshOverlay();
+ if (mOverlayEnabled) {
+ getTaskOverlay().refreshActionVisibility(mThumbnailData);
+ }
} else {
mBitmapShader = null;
mThumbnailData = null;
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 8249887..696c308 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1930,7 +1930,7 @@
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
- TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Key event", event);
+ TestLogging.recordKeyEvent(TestProtocol.SEQUENCE_MAIN, "Key event", event);
return (event.getKeyCode() == KeyEvent.KEYCODE_HOME) || super.dispatchKeyEvent(event);
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 83ca08d..ae42d74 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -16,8 +16,6 @@
package com.android.launcher3;
-import static androidx.annotation.VisibleForTesting.PROTECTED;
-
import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_EXIT_DELAY;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
import static com.android.launcher3.LauncherState.ALL_APPS;
@@ -65,8 +63,6 @@
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.Toast;
-import androidx.annotation.VisibleForTesting;
-
import com.android.launcher3.accessibility.AccessibleDragListenerAdapter;
import com.android.launcher3.accessibility.WorkspaceAccessibilityHelper;
import com.android.launcher3.anim.Interpolators;
@@ -462,7 +458,6 @@
}
@Override
- @VisibleForTesting(otherwise = PROTECTED)
public int getPanelCount() {
return isTwoPanelEnabled() ? 2 : super.getPanelCount();
}
diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java
index bc5129d..86acff7 100644
--- a/src/com/android/launcher3/testing/TestInformationHandler.java
+++ b/src/com/android/launcher3/testing/TestInformationHandler.java
@@ -102,14 +102,22 @@
l -> WidgetsFullSheet.getWidgetsView(l).getCurrentScrollY());
}
+ case TestProtocol.REQUEST_TARGET_INSETS: {
+ return getUIProperty(Bundle::putParcelable, activity -> {
+ WindowInsets insets = activity.getWindow()
+ .getDecorView().getRootWindowInsets();
+ return Insets.max(
+ insets.getSystemGestureInsets(),
+ insets.getSystemWindowInsets());
+ }, this::getCurrentActivity);
+ }
+
case TestProtocol.REQUEST_WINDOW_INSETS: {
- return getUIProperty(Bundle::putParcelable, a -> {
- WindowInsets insets = a.getWindow()
+ return getUIProperty(Bundle::putParcelable, activity -> {
+ WindowInsets insets = activity.getWindow()
.getDecorView().getRootWindowInsets();
return Insets.subtract(
- Insets.max(
- insets.getSystemGestureInsets(),
- insets.getSystemWindowInsets()),
+ insets.getSystemWindowInsets(),
Insets.of(0, 0, 0, mDeviceProfile.nonOverlappingTaskbarInset));
}, this::getCurrentActivity);
}
@@ -130,13 +138,18 @@
case TestProtocol.REQUEST_IS_TWO_PANELS:
response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD,
- mDeviceProfile.isTwoPanels);
+ mDeviceProfile.isTwoPanels);
return response;
case TestProtocol.REQUEST_SET_FORCE_PAUSE_TIMEOUT:
TestProtocol.sForcePauseTimeout = Long.parseLong(arg);
return response;
+ case TestProtocol.REQUEST_GET_HAD_NONTEST_EVENTS:
+ response.putBoolean(
+ TestProtocol.TEST_INFO_RESPONSE_FIELD, TestLogging.sHadEventsNotFromTest);
+ return response;
+
default:
return null;
}
diff --git a/src/com/android/launcher3/testing/TestLogging.java b/src/com/android/launcher3/testing/TestLogging.java
index 51e0819..6cdd3ca 100644
--- a/src/com/android/launcher3/testing/TestLogging.java
+++ b/src/com/android/launcher3/testing/TestLogging.java
@@ -17,6 +17,7 @@
package com.android.launcher3.testing;
import android.util.Log;
+import android.view.KeyEvent;
import android.view.MotionEvent;
import com.android.launcher3.Utilities;
@@ -25,6 +26,7 @@
public final class TestLogging {
private static BiConsumer<String, String> sEventConsumer;
+ public static boolean sHadEventsNotFromTest;
private static void recordEventSlow(String sequence, String event) {
Log.d(TestProtocol.TAPL_EVENTS_TAG, sequence + " / " + event);
@@ -46,9 +48,17 @@
}
}
+ public static void recordKeyEvent(String sequence, String message, KeyEvent event) {
+ if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
+ recordEventSlow(sequence, message + ": " + event);
+ if (event.getDeviceId() != -1) sHadEventsNotFromTest = true;
+ }
+ }
+
public static void recordMotionEvent(String sequence, String message, MotionEvent event) {
if (Utilities.IS_RUNNING_IN_TEST_HARNESS && event.getAction() != MotionEvent.ACTION_MOVE) {
recordEventSlow(sequence, message + ": " + event);
+ if (event.getDeviceId() != -1) sHadEventsNotFromTest = true;
}
}
diff --git a/src/com/android/launcher3/testing/TestProtocol.java b/src/com/android/launcher3/testing/TestProtocol.java
index d73c4b4..38cbbe7 100644
--- a/src/com/android/launcher3/testing/TestProtocol.java
+++ b/src/com/android/launcher3/testing/TestProtocol.java
@@ -86,6 +86,7 @@
public static final String REQUEST_APP_LIST_FREEZE_FLAGS = "app-list-freeze-flags";
public static final String REQUEST_APPS_LIST_SCROLL_Y = "apps-list-scroll-y";
public static final String REQUEST_WIDGETS_SCROLL_Y = "widgets-scroll-y";
+ public static final String REQUEST_TARGET_INSETS = "target-insets";
public static final String REQUEST_WINDOW_INSETS = "window-insets";
public static final String REQUEST_PID = "pid";
public static final String REQUEST_FORCE_GC = "gc";
@@ -93,6 +94,7 @@
public static final String REQUEST_RECENT_TASKS_LIST = "recent-tasks-list";
public static final String REQUEST_START_EVENT_LOGGING = "start-event-logging";
public static final String REQUEST_GET_TEST_EVENTS = "get-test-events";
+ public static final String REQUEST_GET_HAD_NONTEST_EVENTS = "get-had-nontest-events";
public static final String REQUEST_STOP_EVENT_LOGGING = "stop-event-logging";
public static final String REQUEST_CLEAR_DATA = "clear-data";
public static final String REQUEST_IS_TABLET = "is-tablet";
@@ -116,4 +118,6 @@
public static final String WORK_PROFILE_REMOVED = "b/159671700";
public static final String FALLBACK_ACTIVITY_NO_SET = "b/181019015";
public static final String THIRD_PARTY_LAUNCHER_NOT_SET = "b/187080582";
+ public static final String MOTION_PAUSE_TIMEOUT = "b/194114179";
+ public static final String TASK_VIEW_ID_CRASH = "b/195430732";
}
diff --git a/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java b/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java
index b8554e4..c51f66f 100644
--- a/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java
+++ b/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java
@@ -63,31 +63,37 @@
*
* TODO: do different behavior if it's a live wallpaper?
*/
- private void wallpaperOffsetForScroll(int scroll, int numScrollingPages, final int[] out) {
+ private void wallpaperOffsetForScroll(int scroll, int numScrollableScreens, final int[] out) {
out[1] = 1;
// To match the default wallpaper behavior in the system, we default to either the left
// or right edge on initialization
- if (mLockedToDefaultPage || numScrollingPages <= 1) {
+ if (mLockedToDefaultPage || numScrollableScreens <= 1) {
out[0] = mIsRtl ? 1 : 0;
return;
}
// Distribute the wallpaper parallax over a minimum of MIN_PARALLAX_PAGE_SPAN workspace
// screens, not including the custom screen, and empty screens (if > MIN_PARALLAX_PAGE_SPAN)
- int numPagesForWallpaperParallax = mWallpaperIsLiveWallpaper ? numScrollingPages :
- Math.max(MIN_PARALLAX_PAGE_SPAN, numScrollingPages);
+ int numScreensForWallpaperParallax = mWallpaperIsLiveWallpaper ? numScrollableScreens :
+ Math.max(MIN_PARALLAX_PAGE_SPAN, numScrollableScreens);
// Offset by the custom screen
- int leftPageIndex;
- int rightPageIndex;
- if (mIsRtl) {
- rightPageIndex = 0;
- leftPageIndex = rightPageIndex + numScrollingPages - 1;
- } else {
- leftPageIndex = 0;
- rightPageIndex = leftPageIndex + numScrollingPages - 1;
- }
+
+ // Don't confuse screens & pages in this function. In a phone UI, we often use screens &
+ // pages interchangeably. However, in a n-panels UI, where n > 1, the screen in this class
+ // means the scrollable screen. Each screen can consist of at most n panels.
+ // Each panel has at most 1 page. Take 5 pages in 2 panels UI as an example, the Workspace
+ // looks as follow:
+ //
+ // S: scrollable screen, P: page, <E>: empty
+ // S0 S1 S2
+ // _______ _______ ________
+ // |P0|P1| |P2|P3| |P4|<E>|
+ // ¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯
+ int endIndex = getNumPagesExcludingEmpty() - 1;
+ final int leftPageIndex = mIsRtl ? endIndex : 0;
+ final int rightPageIndex = mIsRtl ? 0 : endIndex;
// Calculate the scroll range
int leftPageScrollX = mWorkspace.getScrollForPage(leftPageIndex);
@@ -103,34 +109,56 @@
int adjustedScroll = scroll - leftPageScrollX -
mWorkspace.getLayoutTransitionOffsetForPage(0);
adjustedScroll = Utilities.boundToRange(adjustedScroll, 0, scrollRange);
- out[1] = (numPagesForWallpaperParallax - 1) * scrollRange;
+ out[1] = (numScreensForWallpaperParallax - 1) * scrollRange;
// The offset is now distributed 0..1 between the left and right pages that we care about,
// so we just map that between the pages that we are using for parallax
int rtlOffset = 0;
if (mIsRtl) {
// In RTL, the pages are right aligned, so adjust the offset from the end
- rtlOffset = out[1] - (numScrollingPages - 1) * scrollRange;
+ rtlOffset = out[1] - (numScrollableScreens - 1) * scrollRange;
}
- out[0] = rtlOffset + adjustedScroll * (numScrollingPages - 1);
+ out[0] = rtlOffset + adjustedScroll * (numScrollableScreens - 1);
}
public float wallpaperOffsetForScroll(int scroll) {
- wallpaperOffsetForScroll(scroll, getNumScreensExcludingEmpty(), sTempInt);
+ wallpaperOffsetForScroll(scroll, getNumScrollableScreensExcludingEmpty(), sTempInt);
return ((float) sTempInt[0]) / sTempInt[1];
}
- private int getNumScreensExcludingEmpty() {
- int numScrollingPages = mWorkspace.getChildCount();
- if (numScrollingPages >= MIN_PARALLAX_PAGE_SPAN && mWorkspace.hasExtraEmptyScreen()) {
- return numScrollingPages - 1;
+ /**
+ * Returns the number of screens that can be scrolled.
+ *
+ * <p>In an usual phone UI, the number of scrollable screens is equal to the number of
+ * CellLayouts because each screen has exactly 1 CellLayout.
+ *
+ * <p>In a n-panels UI, a screen shows n panels. Each panel has at most 1 CellLayout. Take
+ * 2-panels UI as an example: let's say there are 5 CellLayouts in the Workspace. the number of
+ * scrollable screens will be 3 = ⌈5 / 2⌉.
+ */
+ private int getNumScrollableScreensExcludingEmpty() {
+ float numOfPages = getNumPagesExcludingEmpty();
+ return (int) Math.ceil(numOfPages / mWorkspace.getPanelCount());
+ }
+
+ /**
+ * Returns the number of non-empty pages in the Workspace.
+ *
+ * <p>If a user starts dragging on the rightmost (or leftmost in RTL), an empty CellLayout is
+ * added to the Workspace. This empty CellLayout add as a hover-over target for adding a new
+ * page. To avoid janky motion effect, we ignore this empty CellLayout.
+ */
+ private int getNumPagesExcludingEmpty() {
+ int numOfPages = mWorkspace.getChildCount();
+ if (numOfPages >= MIN_PARALLAX_PAGE_SPAN && mWorkspace.hasExtraEmptyScreen()) {
+ return numOfPages - 1;
} else {
- return numScrollingPages;
+ return numOfPages;
}
}
public void syncWithScroll() {
- int numScreens = getNumScreensExcludingEmpty();
+ int numScreens = getNumScrollableScreensExcludingEmpty();
wallpaperOffsetForScroll(mWorkspace.getScrollX(), numScreens, sTempInt);
Message msg = Message.obtain(mHandler, MSG_UPDATE_OFFSET, sTempInt[0], sTempInt[1],
mWindowToken);
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
index dcb6dc1..0d5b9ad 100644
--- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
+++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
@@ -254,26 +254,12 @@
return mDevice;
}
- private boolean hasSystemUiObject(String resId) {
- return mDevice.hasObject(By.res(SYSTEMUI_PACKAGE, resId));
- }
-
@Before
public void setUp() throws Exception {
mLauncher.onTestStart();
- Log.d(TAG, "Before disabling battery defender");
- mDevice.executeShellCommand("setprop vendor.battery.defender.disable 1");
- Log.d(TAG, "Before enabling stay awake");
- mDevice.executeShellCommand("settings put global stay_on_while_plugged_in 3");
- for (int i = 0; i < 10 && hasSystemUiObject("keyguard_status_view"); ++i) {
- Log.d(TAG, "Before unlocking the phone");
- mDevice.executeShellCommand("input keyevent 82");
- mDevice.waitForIdle();
- }
- Assert.assertTrue("Keyguard still visible",
+ Assert.assertTrue("Keyguard is visible, which is likely caused by a crash in SysUI",
TestHelpers.wait(
Until.gone(By.res(SYSTEMUI_PACKAGE, "keyguard_status_view")), 60000));
- Log.d(TAG, "Keyguard is not visible");
final String launcherPackageName = mDevice.getLauncherPackageName();
try {
diff --git a/tests/src/com/android/launcher3/util/rule/FailureWatcher.java b/tests/src/com/android/launcher3/util/rule/FailureWatcher.java
index 5fbf847..60529a4 100644
--- a/tests/src/com/android/launcher3/util/rule/FailureWatcher.java
+++ b/tests/src/com/android/launcher3/util/rule/FailureWatcher.java
@@ -13,6 +13,7 @@
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
import java.io.File;
import java.io.FileOutputStream;
@@ -38,6 +39,26 @@
}
@Override
+ public Statement apply(Statement base, Description description) {
+ return new Statement() {
+ @Override
+ public void evaluate() throws Throwable {
+ try {
+ base.evaluate();
+ } finally {
+ if (mLauncher.hadNontestEvents()) {
+ throw new AssertionError(
+ "Launcher received events not sent by the test. This may mean "
+ + "that the touch screen of the lab device has sent false"
+ + " events. See the logcat for TaplEvents tag and look "
+ + "for events with deviceId != -1");
+ }
+ }
+ }
+ };
+ }
+
+ @Override
protected void failed(Throwable e, Description description) {
onError(mDevice, description, e);
}
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index abcc778..ded4282 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -288,6 +288,11 @@
}
Insets getTargetInsets() {
+ return getTestInfo(TestProtocol.REQUEST_TARGET_INSETS)
+ .getParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD);
+ }
+
+ Insets getWindowInsets() {
return getTestInfo(TestProtocol.REQUEST_WINDOW_INSETS)
.getParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD);
}
@@ -306,6 +311,11 @@
getTestInfo(TestProtocol.REQUEST_SET_FORCE_PAUSE_TIMEOUT, Long.toString(timeout));
}
+ public boolean hadNontestEvents() {
+ return getTestInfo(TestProtocol.REQUEST_GET_HAD_NONTEST_EVENTS)
+ .getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD);
+ }
+
void setActiveContainer(VisibleContainer container) {
sActiveContainer = new WeakReference<>(container);
}
@@ -1128,7 +1138,7 @@
}
int getBottomGestureSize() {
- return Math.max(getTargetInsets().bottom, ResourceUtils.getNavbarSize(
+ return Math.max(getWindowInsets().bottom, ResourceUtils.getNavbarSize(
ResourceUtils.NAVBAR_BOTTOM_GESTURE_SIZE, getResources())) + 1;
}