summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@android.com>2011-03-23 12:44:23 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-03-23 12:44:23 -0700
commit6f67e7bf831147257e078dd72a22f2e43e009122 (patch)
treed857d58c650232640c3c2216cd21d25d7016423e
parenta4206029cbb8f6c02c47db52f84b7d52e154e35a (diff)
parent2e383bc6445b37d3b37fbc5b7620cd4716c5692c (diff)
downloadframeworks_base-6f67e7bf831147257e078dd72a22f2e43e009122.zip
frameworks_base-6f67e7bf831147257e078dd72a22f2e43e009122.tar.gz
frameworks_base-6f67e7bf831147257e078dd72a22f2e43e009122.tar.bz2
am 2e383bc6: Merge "Making it possible to call SIP calls with special allowed chars."
* commit '2e383bc6445b37d3b37fbc5b7620cd4716c5692c': Making it possible to call SIP calls with special allowed chars.
-rw-r--r--[-rwxr-xr-x]telephony/java/com/android/internal/telephony/sip/SipPhone.java5
-rw-r--r--voip/java/com/android/server/sip/SipHelper.java8
2 files changed, 9 insertions, 4 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 {
diff --git a/voip/java/com/android/server/sip/SipHelper.java b/voip/java/com/android/server/sip/SipHelper.java
index 518543a..f24e3fb 100644
--- a/voip/java/com/android/server/sip/SipHelper.java
+++ b/voip/java/com/android/server/sip/SipHelper.java
@@ -27,6 +27,8 @@ import java.text.ParseException;
import java.util.ArrayList;
import java.util.EventObject;
import java.util.List;
+import java.util.regex.Pattern;
+
import javax.sip.ClientTransaction;
import javax.sip.Dialog;
import javax.sip.DialogTerminatedEvent;
@@ -215,9 +217,11 @@ class SipHelper {
String tag) throws ParseException, SipException {
FromHeader fromHeader = createFromHeader(userProfile, tag);
ToHeader toHeader = createToHeader(userProfile);
+
+ String replaceStr = Pattern.quote(userProfile.getUserName() + "@");
SipURI requestURI = mAddressFactory.createSipURI(
- userProfile.getUriString().replaceFirst(
- userProfile.getUserName() + "@", ""));
+ userProfile.getUriString().replaceFirst(replaceStr, ""));
+
List<ViaHeader> viaHeaders = createViaHeaders();
CallIdHeader callIdHeader = createCallIdHeader();
CSeqHeader cSeqHeader = createCSeqHeader(requestType);