commit | be405bfc568f513bbaf2c57337ba17dd239cfc43 | [log] [tgz] |
---|---|---|
author | Steven Ng <stevenckng@google.com> | Tue Jun 01 10:29:56 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Jun 01 10:29:56 2021 +0000 |
tree | 1f5da8ccdebdff51bbda5f4e73c05c23272a73b5 | |
parent | b71bb162ed80a7ccbf966a6ca1f87b3cbdf9f2df [diff] | |
parent | 755723403b71b87f44d80b11900aca758b8da584 [diff] |
Merge "Don't dismiss keyboard after clicking X button on the widgets search bar" into sc-dev am: 755723403b Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14748544 Change-Id: Ic244ee231a6924ab111fcd123a4c6959034326f9
diff --git a/robolectric_tests/src/com/android/launcher3/widget/picker/search/WidgetsSearchBarControllerTest.java b/robolectric_tests/src/com/android/launcher3/widget/picker/search/WidgetsSearchBarControllerTest.java index a057a84..7ac879a 100644 --- a/robolectric_tests/src/com/android/launcher3/widget/picker/search/WidgetsSearchBarControllerTest.java +++ b/robolectric_tests/src/com/android/launcher3/widget/picker/search/WidgetsSearchBarControllerTest.java
@@ -19,7 +19,6 @@ import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; @@ -131,18 +130,14 @@ public void cancelSearch_shouldInformSearchModeListenerToClearResultsAndExitSearch() { mCancelButton.performClick(); - // 1 time explicitly from the cancel button on click listener. - // Another from the setText("") the cancel button on click listener causing afterTextChange. - verify(mSearchModeListener, times(2)).exitSearchMode(); + verify(mSearchModeListener).exitSearchMode(); } @Test public void cancelSearch_shouldCancelSearch() { mCancelButton.performClick(); - // 1 time explicitly from the cancel button on click listener. - // Another from the setText("") the cancel button on click listener causing afterTextChange. - verify(mSearchAlgorithm, times(2)).cancel(true); + verify(mSearchAlgorithm).cancel(true); verifyNoMoreInteractions(mSearchAlgorithm); }
diff --git a/src/com/android/launcher3/widget/picker/search/WidgetsSearchBarController.java b/src/com/android/launcher3/widget/picker/search/WidgetsSearchBarController.java index a8294c0..2751a52 100644 --- a/src/com/android/launcher3/widget/picker/search/WidgetsSearchBarController.java +++ b/src/com/android/launcher3/widget/picker/search/WidgetsSearchBarController.java
@@ -101,10 +101,8 @@ @Override public void clearSearchResult() { - mSearchAlgorithm.cancel(/* interruptActiveRequests= */ true); + // Any existing search session will be cancelled by setting text to empty. mInput.setText(""); - clearFocus(); - mSearchModeListener.exitSearchMode(); } /**