summaryrefslogtreecommitdiffstats
path: root/voip/java/android/net/sip
diff options
context:
space:
mode:
authorHung-ying Tyan <tyanh@google.com>2010-11-30 16:23:54 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2010-11-30 16:23:54 -0800
commitebf28fa3f086bd5d3fa8d988fe4b8a8faeddd710 (patch)
tree259a663c7a687d8e19dd32e4b051bb38450383e6 /voip/java/android/net/sip
parent1981674771f9517899c346d3095b4227e63bd2a2 (diff)
parent0e58a9529895e270dae90e69486a59e41de714b8 (diff)
downloadframeworks_base-ebf28fa3f086bd5d3fa8d988fe4b8a8faeddd710.zip
frameworks_base-ebf28fa3f086bd5d3fa8d988fe4b8a8faeddd710.tar.gz
frameworks_base-ebf28fa3f086bd5d3fa8d988fe4b8a8faeddd710.tar.bz2
am 0e58a952: am 0bba9535: Merge "Throw proper exceptions in SipManager" into gingerbread
* commit '0e58a9529895e270dae90e69486a59e41de714b8': Throw proper exceptions in SipManager
Diffstat (limited to 'voip/java/android/net/sip')
-rw-r--r--voip/java/android/net/sip/SipManager.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/voip/java/android/net/sip/SipManager.java b/voip/java/android/net/sip/SipManager.java
index 8aaa805..2e38662 100644
--- a/voip/java/android/net/sip/SipManager.java
+++ b/voip/java/android/net/sip/SipManager.java
@@ -314,10 +314,6 @@ public class SipManager {
SipAudioCall call = new SipAudioCall(mContext, localProfile);
call.setListener(listener);
SipSession s = createSipSession(localProfile, null);
- if (s == null) {
- throw new SipException(
- "Failed to create SipSession; network available?");
- }
call.makeCall(peerProfile, s, timeout);
return call;
}
@@ -366,7 +362,9 @@ public class SipManager {
*/
public SipAudioCall takeAudioCall(Intent incomingCallIntent,
SipAudioCall.Listener listener) throws SipException {
- if (incomingCallIntent == null) return null;
+ if (incomingCallIntent == null) {
+ throw new SipException("Cannot retrieve session with null intent");
+ }
String callId = getCallId(incomingCallIntent);
if (callId == null) {
@@ -381,7 +379,9 @@ public class SipManager {
try {
ISipSession session = mSipService.getPendingSession(callId);
- if (session == null) return null;
+ if (session == null) {
+ throw new SipException("No pending session for the call");
+ }
SipAudioCall call = new SipAudioCall(
mContext, session.getLocalProfile());
call.attachCall(new SipSession(session), offerSd);
@@ -526,6 +526,10 @@ public class SipManager {
SipSession.Listener listener) throws SipException {
try {
ISipSession s = mSipService.createSession(localProfile, null);
+ if (s == null) {
+ throw new SipException(
+ "Failed to create SipSession; network unavailable?");
+ }
return new SipSession(s, listener);
} catch (RemoteException e) {
throw new SipException("createSipSession()", e);
@@ -541,7 +545,7 @@ public class SipManager {
try {
return mSipService.getListOfProfiles();
} catch (RemoteException e) {
- return null;
+ return new SipProfile[0];
}
}