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

Commit feb77f1e authored by Dmitri Plotnikov's avatar Dmitri Plotnikov Committed by Android (Google) Code Review
Browse files

Merge "Absorbing extra key events on contact search." into froyo

parents a497ce5d 95020ca8
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -452,6 +452,7 @@ public class ContactsListActivity extends ListActivity implements View.OnCreateC
    private boolean mShowNumberOfContacts;
    private boolean mShowNumberOfContacts;


    private boolean mShowSearchSnippets;
    private boolean mShowSearchSnippets;
    private boolean mSearchInitiated;


    private String mInitialFilter;
    private String mInitialFilter;


@@ -1058,6 +1059,7 @@ public class ContactsListActivity extends ListActivity implements View.OnCreateC
            startQuery();
            startQuery();
        }
        }
        mJustCreated = false;
        mJustCreated = false;
        mSearchInitiated = false;
    }
    }


    /**
    /**
@@ -1651,9 +1653,10 @@ public class ContactsListActivity extends ListActivity implements View.OnCreateC
     * bringing up the search UI first.
     * bringing up the search UI first.
     */
     */
    public boolean onKey(View v, int keyCode, KeyEvent event) {
    public boolean onKey(View v, int keyCode, KeyEvent event) {
        if (!mSearchMode && (mMode & MODE_MASK_NO_FILTER) == 0) {
        if (!mSearchMode && (mMode & MODE_MASK_NO_FILTER) == 0 && !mSearchInitiated) {
            int unicodeChar = event.getUnicodeChar();
            int unicodeChar = event.getUnicodeChar();
            if (unicodeChar != 0) {
            if (unicodeChar != 0) {
                mSearchInitiated = true;
                startSearch(new String(new int[]{unicodeChar}, 0, 1), false, null, false);
                startSearch(new String(new int[]{unicodeChar}, 0, 1), false, null, false);
                return true;
                return true;
            }
            }