Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75572340 authored by Steven Ng's avatar Steven Ng Committed by Android (Google) Code Review
Browse files

Merge "Don't dismiss keyboard after clicking X button on the widgets search bar" into sc-dev

parents a4adcbc8 7a36ad39
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.launcher3.widget.picker.search;
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 class WidgetsSearchBarControllerTest {
    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);
    }

+1 −3
Original line number Diff line number Diff line
@@ -101,10 +101,8 @@ public class WidgetsSearchBarController implements TextWatcher,

    @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();
    }

    /**