diff options
author | Magnus Strandberg <magnus.strandberg@sonyericsson.com> | 2011-03-22 08:03:58 +0100 |
---|---|---|
committer | Johan Redestig <johan.redestig@sonyericsson.com> | 2011-03-22 08:03:58 +0100 |
commit | b5c72ead014a509c0f84884d1f2dac1ff9deec8e (patch) | |
tree | 37515f9bc7852be8637b1846c4ddf0cf96418e9a /telephony | |
parent | d973bed36cb4d4da1d97f309119f4114f60e7171 (diff) | |
download | frameworks_base-b5c72ead014a509c0f84884d1f2dac1ff9deec8e.zip frameworks_base-b5c72ead014a509c0f84884d1f2dac1ff9deec8e.tar.gz frameworks_base-b5c72ead014a509c0f84884d1f2dac1ff9deec8e.tar.bz2 |
Making it possible to call SIP calls with special allowed chars.
Since String.replaceFirst uses regex and since SIP user names are
allowed to include regex charaters such as '+', the code must
fist convert the string to a literal pattern String before using
replaceFirst method.
Change-Id: I25eac852bd620724ca1c5b2befc023af9dae3c1a
Diffstat (limited to 'telephony')
-rw-r--r--[-rwxr-xr-x] | telephony/java/com/android/internal/telephony/sip/SipPhone.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/telephony/java/com/android/internal/telephony/sip/SipPhone.java b/telephony/java/com/android/internal/telephony/sip/SipPhone.java index 461e4fb..e37afda 100755..100644 --- a/telephony/java/com/android/internal/telephony/sip/SipPhone.java +++ b/telephony/java/com/android/internal/telephony/sip/SipPhone.java @@ -41,6 +41,7 @@ import com.android.internal.telephony.UUSInfo; import java.text.ParseException; import java.util.List; +import java.util.regex.Pattern; /** * {@hide} @@ -383,8 +384,8 @@ public class SipPhone extends SipPhoneBase { Connection dial(String originalNumber) throws SipException { String calleeSipUri = originalNumber; if (!calleeSipUri.contains("@")) { - calleeSipUri = mProfile.getUriString().replaceFirst( - mProfile.getUserName() + "@", + String replaceStr = Pattern.quote(mProfile.getUserName() + "@"); + calleeSipUri = mProfile.getUriString().replaceFirst(replaceStr, calleeSipUri + "@"); } try { |