commit | 4b4fc0c1dff9d2735af356e11fd3ede8a5a19f02 | [log] [tgz] |
---|---|---|
author | Steven Ng <stevenckng@google.com> | Tue Jun 01 10:30:07 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Jun 01 10:30:07 2021 +0000 |
tree | 1b408f440ee8f10e1da2bbb13b1cb22e0fda5986 | |
parent | f92e9cb901d1cbc8874a11ca06b66775a04c2a9a [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: I312a42c89ae0e8d194eb94f66b2512e1bc8e8d5b
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(); } /**