diff options
author | Yorke Lee <yorkelee@google.com> | 2014-04-16 19:10:00 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-04-16 19:10:00 +0000 |
commit | 98a65b74af3f960ed4d20688292522c6cfbc8a00 (patch) | |
tree | 6bb4a583459a50df0030075f530da908b7517956 | |
parent | edf0aeaf1f726f65575f1981306d46c2121cb4e1 (diff) | |
parent | a63d4469cdb92e717599d13830c9f43584fb66ef (diff) |
am a63d4469: Merge "Don\'t set search query immediately if searchview is null"
* commit 'a63d4469cdb92e717599d13830c9f43584fb66ef':
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); |