diff options
author | Yorke Lee <yorkelee@google.com> | 2013-09-19 17:44:12 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2013-09-20 08:53:17 -0700 |
commit | 604d48099cd8e0bcf2f992237082600837630038 (patch) | |
tree | 7c91f26c6815f45ea9e369023323eda7a8a3d4ec /src/com/android/dialer/list/DialerPhoneNumberListAdapter.java | |
parent | 4e710e70b47d1236640ef0e2c98134e15e0c6be2 (diff) |
Ignore separators when typing in Dialer search box
Bug: 10842248
Change-Id: Id0c65385af4277120ba6a57c357b980caec149c2
Diffstat (limited to 'src/com/android/dialer/list/DialerPhoneNumberListAdapter.java')
-rw-r--r-- | src/com/android/dialer/list/DialerPhoneNumberListAdapter.java | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java b/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java index e9117107e..4f3a4dabf 100644 --- a/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java +++ b/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java @@ -3,7 +3,6 @@ package com.android.dialer.list; import android.content.Context; import android.content.res.Resources; import android.telephony.PhoneNumberUtils; -import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; @@ -29,9 +28,8 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { public final static int SHORTCUT_INVALID = -1; public final static int SHORTCUT_DIRECT_CALL = 0; public final static int SHORTCUT_ADD_NUMBER_TO_CONTACTS = 1; - public final static int SHORTCUT_ADD_NEW_NAMED_CONTACT = 2; - public final static int SHORTCUT_COUNT = 3; + public final static int SHORTCUT_COUNT = 2; private final boolean[] mShortcutEnabled = new boolean[SHORTCUT_COUNT]; @@ -147,10 +145,6 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { text = resources.getString(R.string.search_shortcut_add_to_contacts); drawableId = R.drawable.ic_add_person_dk; break; - case SHORTCUT_ADD_NEW_NAMED_CONTACT: - text = resources.getString(R.string.search_shortcut_add_to_contacts); - drawableId = R.drawable.ic_add_person_dk; - break; default: throw new IllegalArgumentException("Invalid shortcut type"); } @@ -169,20 +163,8 @@ public class DialerPhoneNumberListAdapter extends PhoneNumberListAdapter { @Override public void setQueryString(String queryString) { - boolean containsNonDialableCharacters = false; - for (int i = 0; i < queryString.length(); i++) { - if (!PhoneNumberUtils.isDialable(queryString.charAt(i))) { - containsNonDialableCharacters = true; - break; - } - } - - if (containsNonDialableCharacters) { - mFormattedQueryString = null; - } else { - mFormattedQueryString = PhoneNumberUtils.formatNumber(queryString, mCountryIso); - } - + mFormattedQueryString = PhoneNumberUtils.formatNumber( + PhoneNumberUtils.convertAndStrip(queryString), mCountryIso); super.setQueryString(queryString); } } |