From 93fbf49a147eeabe7bcdc7da5210ec1395e856b3 Mon Sep 17 00:00:00 2001 From: donaldahn Date: Fri, 25 Feb 2022 02:27:41 +0000 Subject: [PATCH] [Telephony] checking if the delegate is null before calling. Bug: 218415289 Test: TMUS - send rcs message and clear Application Change-Id: I72a2df60f706eace549be24795ea679899611513 Merged-In: I72a2df60f706eace549be24795ea679899611513 --- .../telephony/ims/aidl/SipDelegateAidlWrapper.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/telephony/java/android/telephony/ims/aidl/SipDelegateAidlWrapper.java b/telephony/java/android/telephony/ims/aidl/SipDelegateAidlWrapper.java index f0048248a5ccc..b154a999c25f7 100644 --- a/telephony/java/android/telephony/ims/aidl/SipDelegateAidlWrapper.java +++ b/telephony/java/android/telephony/ims/aidl/SipDelegateAidlWrapper.java @@ -47,6 +47,9 @@ public class SipDelegateAidlWrapper implements DelegateStateCallback, DelegateMe @Override public void sendMessage(SipMessage sipMessage, long configVersion) { SipDelegate d = mDelegate; + if (d == null) { + return; + } final long token = Binder.clearCallingIdentity(); try { mExecutor.execute(() -> d.sendMessage(sipMessage, configVersion)); @@ -58,6 +61,9 @@ public class SipDelegateAidlWrapper implements DelegateStateCallback, DelegateMe @Override public void notifyMessageReceived(String viaTransactionId) { SipDelegate d = mDelegate; + if (d == null) { + return; + } final long token = Binder.clearCallingIdentity(); try { mExecutor.execute(() -> d.notifyMessageReceived(viaTransactionId)); @@ -70,6 +76,9 @@ public class SipDelegateAidlWrapper implements DelegateStateCallback, DelegateMe @Override public void notifyMessageReceiveError(String viaTransactionId, int reason) { SipDelegate d = mDelegate; + if (d == null) { + return; + } final long token = Binder.clearCallingIdentity(); try { mExecutor.execute(() -> d.notifyMessageReceiveError(viaTransactionId, reason)); @@ -82,6 +91,9 @@ public class SipDelegateAidlWrapper implements DelegateStateCallback, DelegateMe @Override public void cleanupSession(String callId) { SipDelegate d = mDelegate; + if (d == null) { + return; + } final long token = Binder.clearCallingIdentity(); try { mExecutor.execute(() -> d.cleanupSession(callId));