diff options
-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); |