summaryrefslogtreecommitdiffstats
path: root/voip
diff options
context:
space:
mode:
authorConley Owens <cco3@android.com>2011-08-02 13:21:12 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-08-02 13:21:12 -0700
commite1d271546767a8e2213aabba92506af9e97020b4 (patch)
tree85827bf7c9c4d7bac39c130000299a8fa153a0e8 /voip
parenta2616220d24b994e79fcbf33f7ce8a311fa9e8ac (diff)
parentf87743e7bdfd10b9a1719036a6320a32df078879 (diff)
downloadframeworks_base-e1d271546767a8e2213aabba92506af9e97020b4.zip
frameworks_base-e1d271546767a8e2213aabba92506af9e97020b4.tar.gz
frameworks_base-e1d271546767a8e2213aabba92506af9e97020b4.tar.bz2
am f87743e7: Merge "Prevent NullPointerException cases while using SipService."
* commit 'f87743e7bdfd10b9a1719036a6320a32df078879': Prevent NullPointerException cases while using SipService.
Diffstat (limited to 'voip')
-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);
}