summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConley Owens <cco3@android.com>2011-08-02 13:32:26 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-08-02 13:32:26 -0700
commit53ad2c7fe212a08ae05fb4d7f27d42f9a0a4b912 (patch)
tree83ce60d0fb85d48cb7b2415a0fb67b80a912529d
parent6dd7431710c3737484044ac54d6cd6da1effb614 (diff)
parent0793586bf8f4dce71d0b4d7ff2f212129b3f76fe (diff)
downloadframeworks_base-53ad2c7fe212a08ae05fb4d7f27d42f9a0a4b912.zip
frameworks_base-53ad2c7fe212a08ae05fb4d7f27d42f9a0a4b912.tar.gz
frameworks_base-53ad2c7fe212a08ae05fb4d7f27d42f9a0a4b912.tar.bz2
am 0793586b: am f8c1f129: am e1d27154: am f87743e7: Merge "Prevent NullPointerException cases while using SipService."
* commit '0793586bf8f4dce71d0b4d7ff2f212129b3f76fe': Prevent NullPointerException cases while using SipService.
-rw-r--r--voip/java/android/net/sip/SipManager.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/voip/java/android/net/sip/SipManager.java b/voip/java/android/net/sip/SipManager.java
index dce46fe..cd0b5c4 100644
--- a/voip/java/android/net/sip/SipManager.java
+++ b/voip/java/android/net/sip/SipManager.java
@@ -471,6 +471,10 @@ public class SipManager {
try {
ISipSession session = mSipService.createSession(localProfile,
createRelay(listener, localProfile.getUriString()));
+ if (session == null) {
+ throw new SipException(
+ "SipService.createSession() returns null");
+ }
session.register(expiryTime);
} catch (RemoteException e) {
throw new SipException("register()", e);
@@ -492,6 +496,10 @@ public class SipManager {
try {
ISipSession session = mSipService.createSession(localProfile,
createRelay(listener, localProfile.getUriString()));
+ if (session == null) {
+ throw new SipException(
+ "SipService.createSession() returns null");
+ }
session.unregister();
} catch (RemoteException e) {
throw new SipException("unregister()", e);
@@ -513,7 +521,7 @@ public class SipManager {
try {
String callId = getCallId(incomingCallIntent);
ISipSession s = mSipService.getPendingSession(callId);
- return new SipSession(s);
+ return ((s == null) ? null : new SipSession(s));
} catch (RemoteException e) {
throw new SipException("getSessionFor()", e);
}