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

Commit 1c244d5f authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Protect against NPE in onCallQualitychange callback.

There are cases where a call session is already cleaned up for a call and
the vendor IMS stack reports a change in call quality after that.  This is
most likely due to timing issues.

Add an NPE check for ImsCall#getSession; worst case we are going to drop
a call quality report -- this is fine since the call session has been
cleaned up so the call quality is moot.

Flag: Simple NPE fix to go into next release.
Fixes: 321133325
Test: Compile; run unit tests.
Change-Id: I230ce5d7e8a8c9787801a5e9919d1288df0bf1d2
parent 5eddfcc7
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -4453,6 +4453,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        public void onCallQualityChanged(ImsCall imsCall, CallQuality callQuality) {
            // convert ServiceState.radioTech to TelephonyManager.NetworkType constant
            mPhone.onCallQualityChanged(callQuality, imsCall.getNetworkType());
            if (imsCall.getSession() != null) {
                String callId = imsCall.getSession().getCallId();
                CallQualityMetrics cqm = mCallQualityMetrics.get(callId);
                if (cqm == null) {
@@ -4460,6 +4461,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                }
                cqm.saveCallQuality(callQuality);
                mCallQualityMetrics.put(callId, cqm);
            }

            ImsPhoneConnection conn = findConnection(imsCall);
            if (conn != null) {