Loading src/com/android/launcher3/testing/TestInformationHandler.java +9 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.os.Bundle; import android.view.WindowInsets; import androidx.annotation.Nullable; import androidx.core.view.WindowInsetsCompat; import com.android.launcher3.CellLayout; import com.android.launcher3.DeviceProfile; Loading Loading @@ -142,6 +143,14 @@ public class TestInformationHandler implements ResourceBasedOverride { }, this::getCurrentActivity); } case TestProtocol.REQUEST_IME_INSETS: { return getUIProperty(Bundle::putParcelable, activity -> { WindowInsetsCompat insets = WindowInsetsCompat.toWindowInsetsCompat( activity.getWindow().getDecorView().getRootWindowInsets()); return insets.getInsets(WindowInsetsCompat.Type.ime()).toPlatformInsets(); }, this::getCurrentActivity); } case TestProtocol.REQUEST_ICON_HEIGHT: { response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, mDeviceProfile.allAppsCellHeightPx); Loading tests/shared/com/android/launcher3/testing/shared/TestProtocol.java +1 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,7 @@ public final class TestProtocol { 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_IME_INSETS = "ime-insets"; public static final String REQUEST_PID = "pid"; public static final String REQUEST_FORCE_GC = "gc"; public static final String REQUEST_RECENT_TASKS_LIST = "recent-tasks-list"; Loading tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +10 −1 Original line number Diff line number Diff line Loading @@ -341,6 +341,11 @@ public final class LauncherInstrumentation { .getParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD); } Insets getImeInsets() { return getTestInfo(TestProtocol.REQUEST_IME_INSETS) .getParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD); } public boolean isTablet() { return getTestInfo(TestProtocol.REQUEST_IS_TABLET) .getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD); Loading Loading @@ -2111,7 +2116,11 @@ public final class LauncherInstrumentation { ? containerBounds.right + 1 : containerBounds.left - 1; } int y = containerBounds.top + containerBounds.height() / 2; // If IME is visible and overlaps the container bounds, touch above it. int bottomBound = Math.min( containerBounds.bottom, getRealDisplaySize().y - getImeInsets().bottom); int y = (bottomBound - containerBounds.top) / 2; final long downTime = SystemClock.uptimeMillis(); final Point tapTarget = new Point(x, y); Loading Loading
src/com/android/launcher3/testing/TestInformationHandler.java +9 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.os.Bundle; import android.view.WindowInsets; import androidx.annotation.Nullable; import androidx.core.view.WindowInsetsCompat; import com.android.launcher3.CellLayout; import com.android.launcher3.DeviceProfile; Loading Loading @@ -142,6 +143,14 @@ public class TestInformationHandler implements ResourceBasedOverride { }, this::getCurrentActivity); } case TestProtocol.REQUEST_IME_INSETS: { return getUIProperty(Bundle::putParcelable, activity -> { WindowInsetsCompat insets = WindowInsetsCompat.toWindowInsetsCompat( activity.getWindow().getDecorView().getRootWindowInsets()); return insets.getInsets(WindowInsetsCompat.Type.ime()).toPlatformInsets(); }, this::getCurrentActivity); } case TestProtocol.REQUEST_ICON_HEIGHT: { response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, mDeviceProfile.allAppsCellHeightPx); Loading
tests/shared/com/android/launcher3/testing/shared/TestProtocol.java +1 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,7 @@ public final class TestProtocol { 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_IME_INSETS = "ime-insets"; public static final String REQUEST_PID = "pid"; public static final String REQUEST_FORCE_GC = "gc"; public static final String REQUEST_RECENT_TASKS_LIST = "recent-tasks-list"; Loading
tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +10 −1 Original line number Diff line number Diff line Loading @@ -341,6 +341,11 @@ public final class LauncherInstrumentation { .getParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD); } Insets getImeInsets() { return getTestInfo(TestProtocol.REQUEST_IME_INSETS) .getParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD); } public boolean isTablet() { return getTestInfo(TestProtocol.REQUEST_IS_TABLET) .getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD); Loading Loading @@ -2111,7 +2116,11 @@ public final class LauncherInstrumentation { ? containerBounds.right + 1 : containerBounds.left - 1; } int y = containerBounds.top + containerBounds.height() / 2; // If IME is visible and overlaps the container bounds, touch above it. int bottomBound = Math.min( containerBounds.bottom, getRealDisplaySize().y - getImeInsets().bottom); int y = (bottomBound - containerBounds.top) / 2; final long downTime = SystemClock.uptimeMillis(); final Point tapTarget = new Point(x, y); Loading