diff options
author | Yorke Lee <yorkelee@google.com> | 2014-04-16 18:47:05 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-04-16 18:47:05 +0000 |
commit | a63d4469cdb92e717599d13830c9f43584fb66ef (patch) | |
tree | b02f1539247f72459fd72e1fe2f82df7c3a5613d | |
parent | 176c76a9b368e786a5e5050c3970d31c57d5b481 (diff) | |
parent | 3c9e7cd12f28c7e79a4b2af442c32f2b519122f1 (diff) |
Merge "Don't set search query immediately if searchview is null"
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 8b9b71ada..54041b087 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -173,6 +173,12 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O */ private boolean mFirstLaunch; + /** + * Search query to be applied to the SearchView in the ActionBar once + * onCreateOptionsMenu has been called. + */ + private String mPendingSearchViewQuery; + // This view points to the Framelayout that houses both the search view and remove view // containers. private View mSearchAndRemoveViewContainer; @@ -648,6 +654,11 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O mSearchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); mSearchView.setOnQueryTextListener(mPhoneSearchQueryTextListener); mSearchView.setIconifiedByDefault(false); + + if (mPendingSearchViewQuery != null) { + mSearchView.setQuery(mPendingSearchViewQuery, false); + mPendingSearchViewQuery = null; + } return super.onCreateOptionsMenu(menu); } @@ -826,6 +837,12 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } final String normalizedQuery = SmartDialNameMatcher.normalizeNumber(query, SmartDialNameMatcher.LATIN_SMART_DIAL_MAP); + if (mSearchView == null) { + if (!TextUtils.isEmpty(normalizedQuery)) { + mPendingSearchViewQuery = normalizedQuery; + } + return; + } if (!TextUtils.equals(mSearchView.getQuery(), normalizedQuery)) { if (DEBUG) { Log.d(TAG, "onDialpadQueryChanged - new query: " + query); |