diff --git a/go/quickstep/src/com/android/quickstep/TouchInteractionService.java b/go/quickstep/src/com/android/quickstep/TouchInteractionService.java index 917800f2a6..577b175661 100644 --- a/go/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/go/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -186,7 +186,7 @@ public class TouchInteractionService extends Service { return mMyBinder; } - public static boolean isInputMonitorInitialized() { + public static boolean isInitialized() { return true; } } diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/QuickstepTestInformationHandler.java index b507044e0a..4eb9df2cbd 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/QuickstepTestInformationHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/QuickstepTestInformationHandler.java @@ -38,7 +38,7 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { case TestProtocol.REQUEST_IS_LAUNCHER_INITIALIZED: { response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD, - TouchInteractionService.isInputMonitorInitialized()); + TouchInteractionService.isInitialized()); return response; } diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java index debed898ef..d10e5123d5 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java @@ -77,7 +77,6 @@ import com.android.launcher3.logging.EventLogArray; import com.android.launcher3.logging.UserEventDispatcher; import com.android.launcher3.model.AppLaunchTracker; import com.android.launcher3.provider.RestoreDbTask; -import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.util.LooperExecutor; import com.android.launcher3.util.UiThreadHelper; import com.android.quickstep.SysUINavigationMode.Mode; @@ -154,6 +153,7 @@ public class TouchInteractionService extends Service implements MAIN_THREAD_EXECUTOR.execute(TouchInteractionService.this::initInputMonitor); MAIN_THREAD_EXECUTOR.execute(TouchInteractionService.this::onSystemUiProxySet); MAIN_THREAD_EXECUTOR.execute(() -> preloadOverview(true /* fromInit */)); + sIsInitialized = true; } @Override @@ -227,15 +227,15 @@ public class TouchInteractionService extends Service implements }; private static boolean sConnected = false; - private static boolean sInputMonitorInitialized = false; + private static boolean sIsInitialized = false; private static final SwipeSharedState sSwipeSharedState = new SwipeSharedState(); public static boolean isConnected() { return sConnected; } - public static boolean isInputMonitorInitialized() { - return sInputMonitorInitialized; + public static boolean isInitialized() { + return sIsInitialized; } public static SwipeSharedState getSwipeSharedState() { @@ -336,7 +336,6 @@ public class TouchInteractionService extends Service implements mInputMonitorCompat.dispose(); mInputMonitorCompat = null; } - sInputMonitorInitialized = false; } private void initInputMonitor() { @@ -354,7 +353,6 @@ public class TouchInteractionService extends Service implements Log.e(TAG, "Unable to create input monitor", e); } initTouchBounds(); - sInputMonitorInitialized = true; } private int getNavbarSize(String resName) { @@ -492,6 +490,7 @@ public class TouchInteractionService extends Service implements @Override public void onDestroy() { + sIsInitialized = false; if (mIsUserUnlocked) { mInputConsumer.unregisterInputConsumer(); mOverviewComponentObserver.onDestroy(); diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 79379e5922..8639ea207d 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -396,7 +396,7 @@ public final class LauncherInstrumentation { } private UiObject2 verifyContainerType(ContainerType containerType) { - //waitForTouchInteractionService(); + waitForLauncherInitialized(); assertEquals("Unexpected display rotation", mExpectedRotation, mDevice.getDisplayRotation()); @@ -468,7 +468,7 @@ public final class LauncherInstrumentation { } } - private void waitForTouchInteractionService() { + private void waitForLauncherInitialized() { for (int i = 0; i < 100; ++i) { if (getTestInfo( TestProtocol.REQUEST_IS_LAUNCHER_INITIALIZED). @@ -477,7 +477,7 @@ public final class LauncherInstrumentation { } SystemClock.sleep(100); } - fail("TouchInteractionService didn't connect"); + fail("Launcher didn't initialize"); } Parcelable executeAndWaitForEvent(Runnable command,