/** original code: public void configureLoader(SmartDialCursorLoader loader) { */ public void configureLoader(Loader<Cursor> loader) { LogUtils.d(TAG, "MTK-DialerSearch, configureLoader, getQueryString: " + getQueryString()); if (DEBUG) { Log.v(TAG, "Configure Loader with query" + getQueryString()); } if (DialerUtils.isDialerSearchEnabled()) { DialerSearchCursorLoader dialerSearchLoader = null; if (loader instanceof DialerSearchCursorLoader) { dialerSearchLoader = (DialerSearchCursorLoader) loader; } else { Log.w(TAG, "MTK-DiaerSearch, Not DialerSearchCursorLoader"); } if (getQueryString() == null) { dialerSearchLoader.configureQuery("", true); } else { dialerSearchLoader.configureQuery(getQueryString(), true); } } else { SmartDialCursorLoader smartDialCursorLoader = null; if (loader instanceof DialerSearchCursorLoader) { smartDialCursorLoader = (SmartDialCursorLoader) loader; } else { Log.w(TAG, "MTK-DiaerSearch, Not SmartDialCursorLoader"); } if (getQueryString() == null) { mNameMatcher = new SmartDialNameMatcher("", SmartDialPrefix.getMap()); smartDialCursorLoader.configureQuery(""); } else { smartDialCursorLoader.configureQuery(getQueryString()); mNameMatcher = new SmartDialNameMatcher( PhoneNumberUtils.normalizeNumber(getQueryString()), SmartDialPrefix.getMap()); } } }
/** * 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); }