/** * Configures the query string to be used to find SmartDial matches. * * @param query The query string user typed. */ public void configureQuery(String query, boolean isSmartQuery) { LogUtils.d(TAG, "MTK-DialerSearch, Configure new query to be " + query); if (isSmartQuery) { mQuery = SmartDialNameMatcher.normalizeNumber(query, SmartDialPrefix.getMap()); } else { mQuery = query; if (DialerSearchUtils.isInValidDialpadString(mQuery)) { mRegularSearch = true; } } mContactsPrefs = new ContactsPreferences(mContext); }
@Override public void onDialpadQueryChanged(String query) { final String normalizedQuery = SmartDialNameMatcher.normalizeNumber(query, SmartDialNameMatcher.LATIN_SMART_DIAL_MAP); if (!TextUtils.equals(mSearchView.getText(), normalizedQuery)) { if (DEBUG) { Log.d(TAG, "onDialpadQueryChanged - new query: " + query); } if (mDialpadFragment == null || !mDialpadFragment.isVisible()) { // This callback can happen if the dialpad fragment is recreated because of // activity destruction. In that case, don't update the search view because // that would bring the user back to the search fragment regardless of the // previous state of the application. Instead, just return here and let the // fragment manager correctly figure out whatever fragment was last displayed. return; } mSearchView.setText(normalizedQuery); } }