summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/list/RegularSearchListAdapter.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/com/android/dialer/list/RegularSearchListAdapter.java b/src/com/android/dialer/list/RegularSearchListAdapter.java
index 6c7045814..2be8a1dd7 100644
--- a/src/com/android/dialer/list/RegularSearchListAdapter.java
+++ b/src/com/android/dialer/list/RegularSearchListAdapter.java
@@ -22,6 +22,7 @@ import android.text.TextUtils;
import com.android.contacts.common.CallUtil;
import com.android.contacts.common.list.DirectoryPartition;
+import com.android.contacts.common.util.PhoneNumberHelper;
import com.android.dialer.calllog.ContactInfo;
import com.android.dialer.service.CachedNumberLookupService;
import com.android.dialer.service.CachedNumberLookupService.CachedContactInfo;
@@ -30,6 +31,7 @@ import com.android.dialer.service.CachedNumberLookupService.CachedContactInfo;
* List adapter to display regular search results.
*/
public class RegularSearchListAdapter extends DialerPhoneNumberListAdapter {
+ private boolean mIsQuerySipAddress;
public RegularSearchListAdapter(Context context) {
super(context);
@@ -67,12 +69,24 @@ public class RegularSearchListAdapter extends DialerPhoneNumberListAdapter {
}
@Override
+ public String getFormattedQueryString() {
+ if (mIsQuerySipAddress) {
+ // Return unnormalized SIP address
+ return getQueryString();
+ }
+ return super.getFormattedQueryString();
+ }
+
+ @Override
public void setQueryString(String queryString) {
// Don't show actions if the query string contains a letter.
final boolean showNumberShortcuts = !TextUtils.isEmpty(getFormattedQueryString())
&& hasDigitsInQueryString();
+ // Email addresses that could be SIP addresses are an exception.
+ mIsQuerySipAddress = PhoneNumberHelper.isUriNumber(queryString);
boolean changed = false;
- changed |= setShortcutEnabled(SHORTCUT_DIRECT_CALL, showNumberShortcuts);
+ changed |= setShortcutEnabled(SHORTCUT_DIRECT_CALL,
+ showNumberShortcuts || mIsQuerySipAddress);
changed |= setShortcutEnabled(SHORTCUT_SEND_SMS_MESSAGE, showNumberShortcuts);
changed |= setShortcutEnabled(SHORTCUT_MAKE_VIDEO_CALL,
showNumberShortcuts && CallUtil.isVideoEnabled(getContext()));