Merge "[Telephony] checking if the delegate is null before calling."

This commit is contained in:
Sungcheol Ahn
2022-03-09 00:52:42 +00:00
committed by Gerrit Code Review

View File

@@ -47,6 +47,9 @@ public class SipDelegateAidlWrapper implements DelegateStateCallback, DelegateMe
@Override @Override
public void sendMessage(SipMessage sipMessage, long configVersion) { public void sendMessage(SipMessage sipMessage, long configVersion) {
SipDelegate d = mDelegate; SipDelegate d = mDelegate;
if (d == null) {
return;
}
final long token = Binder.clearCallingIdentity(); final long token = Binder.clearCallingIdentity();
try { try {
mExecutor.execute(() -> d.sendMessage(sipMessage, configVersion)); mExecutor.execute(() -> d.sendMessage(sipMessage, configVersion));
@@ -58,6 +61,9 @@ public class SipDelegateAidlWrapper implements DelegateStateCallback, DelegateMe
@Override @Override
public void notifyMessageReceived(String viaTransactionId) { public void notifyMessageReceived(String viaTransactionId) {
SipDelegate d = mDelegate; SipDelegate d = mDelegate;
if (d == null) {
return;
}
final long token = Binder.clearCallingIdentity(); final long token = Binder.clearCallingIdentity();
try { try {
mExecutor.execute(() -> d.notifyMessageReceived(viaTransactionId)); mExecutor.execute(() -> d.notifyMessageReceived(viaTransactionId));
@@ -70,6 +76,9 @@ public class SipDelegateAidlWrapper implements DelegateStateCallback, DelegateMe
@Override @Override
public void notifyMessageReceiveError(String viaTransactionId, int reason) { public void notifyMessageReceiveError(String viaTransactionId, int reason) {
SipDelegate d = mDelegate; SipDelegate d = mDelegate;
if (d == null) {
return;
}
final long token = Binder.clearCallingIdentity(); final long token = Binder.clearCallingIdentity();
try { try {
mExecutor.execute(() -> d.notifyMessageReceiveError(viaTransactionId, reason)); mExecutor.execute(() -> d.notifyMessageReceiveError(viaTransactionId, reason));
@@ -82,6 +91,9 @@ public class SipDelegateAidlWrapper implements DelegateStateCallback, DelegateMe
@Override @Override
public void cleanupSession(String callId) { public void cleanupSession(String callId) {
SipDelegate d = mDelegate; SipDelegate d = mDelegate;
if (d == null) {
return;
}
final long token = Binder.clearCallingIdentity(); final long token = Binder.clearCallingIdentity();
try { try {
mExecutor.execute(() -> d.cleanupSession(callId)); mExecutor.execute(() -> d.cleanupSession(callId));