Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fff67ce3 authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Fix RTT NPE due to ImsCall#close being called

When the IMS call is closed, in some cases, a pending RTT
initialization request could still be in the queue to be
processed. Since this depends on resources that have since been
release, it can cause an NPE.

Guard against this condition and return early if this condition
is hit.

Bug: 236279778
Test: atest FrameworksTelephonyTests:ImsCallTest
Change-Id: I1c734eebd8135655752e646c5967e65cfe140c89
parent 2838d390
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -1762,7 +1762,12 @@ public class ImsCall implements ICall {
    public void sendRttMessage(String rttMessage) {
        synchronized(mLockObj) {
            if (mSession == null) {
                loge("sendRttMessage::no session");
                loge("sendRttMessage::no session, ignoring");
                return;
            }
            if (mCallProfile == null || mCallProfile.mMediaProfile == null)  {
                loge("sendRttMessage:: no valid call profile, ignoring");
                return;
            }
            if (!mCallProfile.mMediaProfile.isRttCall()) {
                logi("sendRttMessage::Not an rtt call, ignoring");
@@ -1781,7 +1786,12 @@ public class ImsCall implements ICall {

        synchronized(mLockObj) {
            if (mSession == null) {
                loge("sendRttModifyRequest::no session");
                loge("sendRttModifyRequest::no session, ignoring");
                return;
            }
            if (mCallProfile == null || mCallProfile.mMediaProfile == null)  {
                loge("sendRttModifyRequest:: no valid call profile, ignoring");
                return;
            }
            if (rttOn && mCallProfile.mMediaProfile.isRttCall()) {
                logi("sendRttModifyRequest::Already RTT call, ignoring request to turn on.");
@@ -1815,6 +1825,11 @@ public class ImsCall implements ICall {
        synchronized(mLockObj) {
            if (mSession == null) {
                loge("sendRttModifyResponse::no session");
                return;
            }
            if (mCallProfile == null || mCallProfile.mMediaProfile == null)  {
                loge("sendRttModifyResponse:: no valid call profile, ignoring");
                return;
            }
            if (mCallProfile.mMediaProfile.isRttCall()) {
                logi("sendRttModifyResponse::Already RTT call, ignoring.");