DO NOT MERGE: Delete IMSLifecycleTest#testOnStartInputCalledOnce

The test had been flaky due to inherent design. These tests
were re-written & migrated from host side to device side in P.
Hence we can safely remove them from O.

Bug: 74340797
Test: cts-tradefed run singleCommand cts-dev -m CtsInputMethodServiceHostTestCases
Change-Id: I17e015ad20cbfe3d8fc59f5205cca9756a7b9f36
diff --git a/hostsidetests/inputmethodservice/common/src/android/inputmethodservice/cts/common/test/DeviceTestConstants.java b/hostsidetests/inputmethodservice/common/src/android/inputmethodservice/cts/common/test/DeviceTestConstants.java
index aa90e11..ad48a46 100644
--- a/hostsidetests/inputmethodservice/common/src/android/inputmethodservice/cts/common/test/DeviceTestConstants.java
+++ b/hostsidetests/inputmethodservice/common/src/android/inputmethodservice/cts/common/test/DeviceTestConstants.java
@@ -47,6 +47,4 @@
             = "testSearchView_giveFocusShowIme1";
     public static final String TEST_SEARCH_VIEW_SET_QUERY_HIDE_IME1
             = "testSearchView_setQueryHideIme1";
-    public static final String TEST_ON_START_INPUT_CALLED_ONCE_IME1
-            = "testOnStartInputCalledOnceIme1";
 }
diff --git a/hostsidetests/inputmethodservice/deviceside/devicetest/src/android/inputmethodservice/cts/devicetest/InputMethodServiceDeviceTest.java b/hostsidetests/inputmethodservice/deviceside/devicetest/src/android/inputmethodservice/cts/devicetest/InputMethodServiceDeviceTest.java
index e5613ff..feb8b5f 100644
--- a/hostsidetests/inputmethodservice/deviceside/devicetest/src/android/inputmethodservice/cts/devicetest/InputMethodServiceDeviceTest.java
+++ b/hostsidetests/inputmethodservice/deviceside/devicetest/src/android/inputmethodservice/cts/devicetest/InputMethodServiceDeviceTest.java
@@ -192,38 +192,6 @@
                 TIMEOUT, "CtsInputMethod1.hideSoftInput is called");
     }
 
-    @Test
-    public void testOnStartInputCalledOnceIme1() throws Exception {
-        final TestHelper helper = new TestHelper(
-                getClass(), DeviceTestConstants.TEST_ON_START_INPUT_CALLED_ONCE_IME1);
-
-        helper.launchActivity(DeviceTestConstants.PACKAGE, DeviceTestConstants.TEST_ACTIVITY_CLASS);
-        helper.findUiObject(R.id.text_entry).click();
-
-        // we should've only one onStartInput call.
-        pollingCheck(() -> helper.queryAllEvents()
-                        .collect(startingFrom(helper.isStartOfTest()))
-                        .filter(isFrom(Ime1Constants.CLASS).and(isType(ON_START_INPUT)))
-                        .findAny()
-                        .isPresent(),
-                TIMEOUT, "CtsInputMethod1.onStartInput is called");
-        List<DeviceEvent> startInputEvents = helper.queryAllEvents()
-                .collect(startingFrom(helper.isStartOfTest()))
-                .filter(isFrom(Ime1Constants.CLASS).and(isType(ON_START_INPUT)))
-                .collect(Collectors.toList());
-
-        assertEquals("CtsInputMethod1.onStartInput is called exactly once",
-                startInputEvents.size(),
-                1);
-
-        // check if that single event didn't cause IME restart.
-        final DeviceEvent event = startInputEvents.get(0);
-        Boolean isRestarting = DeviceEvent.getEventParamBoolean(
-                        DeviceEventTypeParam.ON_START_INPUT_RESTARTING, event);
-        assertTrue(isRestarting != null);
-        assertFalse(isRestarting);
-    }
-
     /**
      * Build stream collector of {@link DeviceEvent} collecting sequence that elements have
      * specified types.
diff --git a/hostsidetests/inputmethodservice/hostside/src/android/inputmethodservice/cts/hostside/InputMethodServiceLifecycleTest.java b/hostsidetests/inputmethodservice/hostside/src/android/inputmethodservice/cts/hostside/InputMethodServiceLifecycleTest.java
index f309158..50d5ffe 100644
--- a/hostsidetests/inputmethodservice/hostside/src/android/inputmethodservice/cts/hostside/InputMethodServiceLifecycleTest.java
+++ b/hostsidetests/inputmethodservice/hostside/src/android/inputmethodservice/cts/hostside/InputMethodServiceLifecycleTest.java
@@ -135,17 +135,6 @@
         assertTrue(runDeviceTestMethod(testSetQueryHideIme1));
     }
 
-    @Test
-    public void testOnStartInputCalledOnce() throws Exception {
-        installAndSetIme1();
-
-        final TestInfo testSetQueryHideIme1 = new TestInfo(DeviceTestConstants.PACKAGE,
-                DeviceTestConstants.TEST_CLASS,
-                DeviceTestConstants.TEST_ON_START_INPUT_CALLED_ONCE_IME1);
-        sendTestStartEvent(testSetQueryHideIme1);
-        assertTrue(runDeviceTestMethod(testSetQueryHideIme1));
-    }
-
     private void installAndSetIme1() throws Exception {
         final TestInfo testCreateIme1 = new TestInfo(DeviceTestConstants.PACKAGE,
             DeviceTestConstants.TEST_CLASS, DeviceTestConstants.TEST_CREATE_IME1);