From 5c239ba4f77d3b9b850d34a038d524ea4ab3b5f4 Mon Sep 17 00:00:00 2001 From: Ling Wo Date: Tue, 11 Oct 2022 00:55:32 +0000 Subject: [PATCH] Add enable-suggestion option via TestProcotol so that test can opt-in to show live suggestion Bug: 242246407 Test: atest Change-Id: Icde0185c82b1d34570d83bd8b9750acb57a8e39c --- src/com/android/launcher3/testing/shared/TestProtocol.java | 1 + .../com/android/launcher3/tapl/LauncherInstrumentation.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/com/android/launcher3/testing/shared/TestProtocol.java b/src/com/android/launcher3/testing/shared/TestProtocol.java index 5116b01ba5..91b7b2d850 100644 --- a/src/com/android/launcher3/testing/shared/TestProtocol.java +++ b/src/com/android/launcher3/testing/shared/TestProtocol.java @@ -124,6 +124,7 @@ public final class TestProtocol { "get-grid-task-size-rect-for-tablet"; public static final String REQUEST_GET_OVERVIEW_PAGE_SPACING = "get-overview-page-spacing"; public static final String REQUEST_ENABLE_ROTATION = "enable_rotation"; + public static final String REQUEST_ENABLE_SUGGESTION = "enable-suggestion"; public static boolean sDebugTracing = false; public static final String REQUEST_ENABLE_DEBUG_TRACING = "enable-debug-tracing"; diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 677960df96..5dff40080b 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -382,6 +382,10 @@ public final class LauncherInstrumentation { getTestInfo(TestProtocol.REQUEST_ENABLE_ROTATION, Boolean.toString(on)); } + public void setEnableSuggestion(boolean enableSuggestion) { + getTestInfo(TestProtocol.REQUEST_ENABLE_SUGGESTION, Boolean.toString(enableSuggestion)); + } + public boolean hadNontestEvents() { return getTestInfo(TestProtocol.REQUEST_GET_HAD_NONTEST_EVENTS) .getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD);