diff options
| author | Conley Owens <cco3@android.com> | 2011-08-02 13:30:51 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2011-08-02 13:30:51 -0700 |
| commit | 59ccfe8526aae531d69989ac29d1eacd0938d7d2 (patch) | |
| tree | b4cd5d5758c486e7f9f94da3dbb8945268eddebf | |
| parent | f37799a62848cdb5c7b69695d527c6c52c97f07d (diff) | |
| parent | 088ef46d8b5a849d80a257670bb2a809713b7bf0 (diff) | |
| download | android_frameworks_opt_net_voip-59ccfe8526aae531d69989ac29d1eacd0938d7d2.tar.gz android_frameworks_opt_net_voip-59ccfe8526aae531d69989ac29d1eacd0938d7d2.tar.bz2 android_frameworks_opt_net_voip-59ccfe8526aae531d69989ac29d1eacd0938d7d2.zip | |
am f8c1f129: am e1d27154: am f87743e7: Merge "Prevent NullPointerException cases while using SipService."
* commit 'f8c1f1298ac3ede518c8d29eeb6719746c6afaf0':
Prevent NullPointerException cases while using SipService.
| -rw-r--r-- | java/android/net/sip/SipManager.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/java/android/net/sip/SipManager.java b/java/android/net/sip/SipManager.java index dce46fe..cd0b5c4 100644 --- a/java/android/net/sip/SipManager.java +++ b/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); } |
