am f8c1f129
: am e1d27154
: am f87743e7
: Merge "Prevent NullPointerException cases while using SipService."
* commit 'f8c1f1298ac3ede518c8d29eeb6719746c6afaf0': Prevent NullPointerException cases while using SipService.
This commit is contained in:
@ -471,6 +471,10 @@ public class SipManager {
|
|||||||
try {
|
try {
|
||||||
ISipSession session = mSipService.createSession(localProfile,
|
ISipSession session = mSipService.createSession(localProfile,
|
||||||
createRelay(listener, localProfile.getUriString()));
|
createRelay(listener, localProfile.getUriString()));
|
||||||
|
if (session == null) {
|
||||||
|
throw new SipException(
|
||||||
|
"SipService.createSession() returns null");
|
||||||
|
}
|
||||||
session.register(expiryTime);
|
session.register(expiryTime);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
throw new SipException("register()", e);
|
throw new SipException("register()", e);
|
||||||
@ -492,6 +496,10 @@ public class SipManager {
|
|||||||
try {
|
try {
|
||||||
ISipSession session = mSipService.createSession(localProfile,
|
ISipSession session = mSipService.createSession(localProfile,
|
||||||
createRelay(listener, localProfile.getUriString()));
|
createRelay(listener, localProfile.getUriString()));
|
||||||
|
if (session == null) {
|
||||||
|
throw new SipException(
|
||||||
|
"SipService.createSession() returns null");
|
||||||
|
}
|
||||||
session.unregister();
|
session.unregister();
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
throw new SipException("unregister()", e);
|
throw new SipException("unregister()", e);
|
||||||
@ -513,7 +521,7 @@ public class SipManager {
|
|||||||
try {
|
try {
|
||||||
String callId = getCallId(incomingCallIntent);
|
String callId = getCallId(incomingCallIntent);
|
||||||
ISipSession s = mSipService.getPendingSession(callId);
|
ISipSession s = mSipService.getPendingSession(callId);
|
||||||
return new SipSession(s);
|
return ((s == null) ? null : new SipSession(s));
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
throw new SipException("getSessionFor()", e);
|
throw new SipException("getSessionFor()", e);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user