Loading src/com/android/launcher3/testing/TestInformationHandler.java +5 −2 Original line number Diff line number Diff line Loading @@ -102,8 +102,11 @@ public class TestInformationHandler implements ResourceBasedOverride { return getUIProperty(Bundle::putParcelable, a -> { WindowInsets insets = a.getWindow() .getDecorView().getRootWindowInsets(); return Insets.max( insets.getSystemGestureInsets(), insets.getSystemWindowInsets()); return Insets.subtract( Insets.max( insets.getSystemGestureInsets(), insets.getSystemWindowInsets()), Insets.of(0, 0, 0, mDeviceProfile.nonOverlappingTaskbarInset)); }, this::getCurrentActivity); } Loading tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +11 −8 Original line number Diff line number Diff line Loading @@ -728,18 +728,23 @@ public final class LauncherInstrumentation { // otherwise waitForIdle may return immediately in case when there was a big enough // pause in accessibility events prior to pressing Home. final String action; final boolean launcherWasVisible = isLauncherVisible(); if (getNavigationModel() == NavigationModel.ZERO_BUTTON) { checkForAnomaly(); final Point displaySize = getRealDisplaySize(); boolean gestureStartFromLauncher = isTablet() ? !isLauncher3() || hasLauncherObject(WORKSPACE_RES_ID) : isLauncherVisible(); GestureScope gestureScope = gestureStartFromLauncher ? GestureScope.INSIDE_TO_OUTSIDE : GestureScope.OUTSIDE_WITH_PILFER; if (hasLauncherObject(CONTEXT_MENU_RES_ID)) { linearGesture( displaySize.x / 2, displaySize.y - 1, displaySize.x / 2, 0, ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME, false, GestureScope.INSIDE_TO_OUTSIDE); false, gestureScope); try (LauncherInstrumentation.Closable c1 = addContextLayer( "Swiped up from context menu to home")) { waitUntilLauncherObjectGone(CONTEXT_MENU_RES_ID); Loading @@ -760,9 +765,7 @@ public final class LauncherInstrumentation { displaySize.x / 2, displaySize.y - 1, displaySize.x / 2, 0, ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME, NORMAL_STATE_ORDINAL, launcherWasVisible || isTablet() ? GestureScope.INSIDE_TO_OUTSIDE : GestureScope.OUTSIDE_WITH_PILFER); gestureScope); } } else { log("Hierarchy before clicking home:"); Loading Loading @@ -1115,9 +1118,9 @@ public final class LauncherInstrumentation { "swiping"); } private int getBottomGestureSize() { return ResourceUtils.getNavbarSize( ResourceUtils.NAVBAR_BOTTOM_GESTURE_SIZE, getResources()) + 1; int getBottomGestureSize() { return Math.max(getTargetInsets().bottom, ResourceUtils.getNavbarSize( ResourceUtils.NAVBAR_BOTTOM_GESTURE_SIZE, getResources())) + 1; } int getBottomGestureMarginInContainer(UiObject2 container) { Loading tests/tapl/com/android/launcher3/tapl/Workspace.java +1 −3 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ import androidx.test.uiautomator.By; import androidx.test.uiautomator.Direction; import androidx.test.uiautomator.UiObject2; import com.android.launcher3.ResourceUtils; import com.android.launcher3.testing.TestProtocol; import java.util.regex.Pattern; Loading Loading @@ -72,8 +71,7 @@ public final class Workspace extends Home { mLauncher.addContextLayer("want to switch from workspace to all apps")) { verifyActiveContainer(); final int deviceHeight = mLauncher.getDevice().getDisplayHeight(); final int bottomGestureMargin = ResourceUtils.getNavbarSize( ResourceUtils.NAVBAR_BOTTOM_GESTURE_SIZE, mLauncher.getResources()); final int bottomGestureMargin = mLauncher.getBottomGestureSize(); final int windowCornerRadius = (int) Math.ceil(mLauncher.getWindowCornerRadius()); final int startY = deviceHeight - Math.max(bottomGestureMargin, windowCornerRadius) - 1; final int swipeHeight = mLauncher.getTestInfo( Loading Loading
src/com/android/launcher3/testing/TestInformationHandler.java +5 −2 Original line number Diff line number Diff line Loading @@ -102,8 +102,11 @@ public class TestInformationHandler implements ResourceBasedOverride { return getUIProperty(Bundle::putParcelable, a -> { WindowInsets insets = a.getWindow() .getDecorView().getRootWindowInsets(); return Insets.max( insets.getSystemGestureInsets(), insets.getSystemWindowInsets()); return Insets.subtract( Insets.max( insets.getSystemGestureInsets(), insets.getSystemWindowInsets()), Insets.of(0, 0, 0, mDeviceProfile.nonOverlappingTaskbarInset)); }, this::getCurrentActivity); } Loading
tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +11 −8 Original line number Diff line number Diff line Loading @@ -728,18 +728,23 @@ public final class LauncherInstrumentation { // otherwise waitForIdle may return immediately in case when there was a big enough // pause in accessibility events prior to pressing Home. final String action; final boolean launcherWasVisible = isLauncherVisible(); if (getNavigationModel() == NavigationModel.ZERO_BUTTON) { checkForAnomaly(); final Point displaySize = getRealDisplaySize(); boolean gestureStartFromLauncher = isTablet() ? !isLauncher3() || hasLauncherObject(WORKSPACE_RES_ID) : isLauncherVisible(); GestureScope gestureScope = gestureStartFromLauncher ? GestureScope.INSIDE_TO_OUTSIDE : GestureScope.OUTSIDE_WITH_PILFER; if (hasLauncherObject(CONTEXT_MENU_RES_ID)) { linearGesture( displaySize.x / 2, displaySize.y - 1, displaySize.x / 2, 0, ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME, false, GestureScope.INSIDE_TO_OUTSIDE); false, gestureScope); try (LauncherInstrumentation.Closable c1 = addContextLayer( "Swiped up from context menu to home")) { waitUntilLauncherObjectGone(CONTEXT_MENU_RES_ID); Loading @@ -760,9 +765,7 @@ public final class LauncherInstrumentation { displaySize.x / 2, displaySize.y - 1, displaySize.x / 2, 0, ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME, NORMAL_STATE_ORDINAL, launcherWasVisible || isTablet() ? GestureScope.INSIDE_TO_OUTSIDE : GestureScope.OUTSIDE_WITH_PILFER); gestureScope); } } else { log("Hierarchy before clicking home:"); Loading Loading @@ -1115,9 +1118,9 @@ public final class LauncherInstrumentation { "swiping"); } private int getBottomGestureSize() { return ResourceUtils.getNavbarSize( ResourceUtils.NAVBAR_BOTTOM_GESTURE_SIZE, getResources()) + 1; int getBottomGestureSize() { return Math.max(getTargetInsets().bottom, ResourceUtils.getNavbarSize( ResourceUtils.NAVBAR_BOTTOM_GESTURE_SIZE, getResources())) + 1; } int getBottomGestureMarginInContainer(UiObject2 container) { Loading
tests/tapl/com/android/launcher3/tapl/Workspace.java +1 −3 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ import androidx.test.uiautomator.By; import androidx.test.uiautomator.Direction; import androidx.test.uiautomator.UiObject2; import com.android.launcher3.ResourceUtils; import com.android.launcher3.testing.TestProtocol; import java.util.regex.Pattern; Loading Loading @@ -72,8 +71,7 @@ public final class Workspace extends Home { mLauncher.addContextLayer("want to switch from workspace to all apps")) { verifyActiveContainer(); final int deviceHeight = mLauncher.getDevice().getDisplayHeight(); final int bottomGestureMargin = ResourceUtils.getNavbarSize( ResourceUtils.NAVBAR_BOTTOM_GESTURE_SIZE, mLauncher.getResources()); final int bottomGestureMargin = mLauncher.getBottomGestureSize(); final int windowCornerRadius = (int) Math.ceil(mLauncher.getWindowCornerRadius()); final int startY = deviceHeight - Math.max(bottomGestureMargin, windowCornerRadius) - 1; final int swipeHeight = mLauncher.getTestInfo( Loading