summaryrefslogtreecommitdiffstats
path: root/voip/java/android/net/sip
diff options
context:
space:
mode:
authorHung-ying Tyan <tyanh@google.com>2010-09-30 15:00:34 +0800
committerHung-ying Tyan <tyanh@google.com>2010-09-30 15:00:34 +0800
commit9e1d308e993d451882456e44cfaacae63df7a496 (patch)
treee03098c67c9818aa4829f06bc157de387c7549e5 /voip/java/android/net/sip
parent6a53489ae594d7cc373a00687d6ea2f23d0634df (diff)
downloadframeworks_base-9e1d308e993d451882456e44cfaacae63df7a496.zip
frameworks_base-9e1d308e993d451882456e44cfaacae63df7a496.tar.gz
frameworks_base-9e1d308e993d451882456e44cfaacae63df7a496.tar.bz2
Add uri field to SipManager.ListenerRelay
in case mSession is not available. Change-Id: Ifee2c129e48aa1177f648f176413ab6aa5606770
Diffstat (limited to 'voip/java/android/net/sip')
-rw-r--r--voip/java/android/net/sip/SipManager.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/voip/java/android/net/sip/SipManager.java b/voip/java/android/net/sip/SipManager.java
index 52f5716..a589fe9 100644
--- a/voip/java/android/net/sip/SipManager.java
+++ b/voip/java/android/net/sip/SipManager.java
@@ -173,7 +173,7 @@ public class SipManager {
SipRegistrationListener listener) throws SipException {
try {
mSipService.open3(localProfile, incomingCallBroadcastAction,
- createRelay(listener));
+ createRelay(listener, localProfile.getUriString()));
} catch (RemoteException e) {
throw new SipException("open()", e);
}
@@ -191,7 +191,7 @@ public class SipManager {
SipRegistrationListener listener) throws SipException {
try {
mSipService.setRegistrationListener(
- localProfileUri, createRelay(listener));
+ localProfileUri, createRelay(listener, localProfileUri));
} catch (RemoteException e) {
throw new SipException("setRegistrationListener()", e);
}
@@ -425,8 +425,8 @@ public class SipManager {
public void register(SipProfile localProfile, int expiryTime,
SipRegistrationListener listener) throws SipException {
try {
- ISipSession session = mSipService.createSession(
- localProfile, createRelay(listener));
+ ISipSession session = mSipService.createSession(localProfile,
+ createRelay(listener, localProfile.getUriString()));
session.register(expiryTime);
} catch (RemoteException e) {
throw new SipException("register()", e);
@@ -446,8 +446,8 @@ public class SipManager {
public void unregister(SipProfile localProfile,
SipRegistrationListener listener) throws SipException {
try {
- ISipSession session = mSipService.createSession(
- localProfile, createRelay(listener));
+ ISipSession session = mSipService.createSession(localProfile,
+ createRelay(listener, localProfile.getUriString()));
session.unregister();
} catch (RemoteException e) {
throw new SipException("unregister()", e);
@@ -475,8 +475,8 @@ public class SipManager {
}
private static ISipSessionListener createRelay(
- SipRegistrationListener listener) {
- return ((listener == null) ? null : new ListenerRelay(listener));
+ SipRegistrationListener listener, String uri) {
+ return ((listener == null) ? null : new ListenerRelay(listener, uri));
}
/**
@@ -512,16 +512,18 @@ public class SipManager {
private static class ListenerRelay extends SipSessionAdapter {
private SipRegistrationListener mListener;
+ private String mUri;
// listener must not be null
- public ListenerRelay(SipRegistrationListener listener) {
+ public ListenerRelay(SipRegistrationListener listener, String uri) {
mListener = listener;
+ mUri = uri;
}
private String getUri(ISipSession session) {
try {
return ((session == null)
- ? "no session"
+ ? mUri
: session.getLocalProfile().getUriString());
} catch (RemoteException e) {
throw new RuntimeException(e);