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

Commit 96afde9f authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Correct NPE when active call is disconnected.

Its possible for an active call to be disconnected, in which case it has
no ImsCall.  This causes a NPE in the "shouldDisconnect..." logic.

Test: Manual
Bug: 36777742
Merged-In: I4b4a3564143c60df811ba9f6040ca073e49f7487
Change-Id: I00cba85d426aedbbb46251528953b314f4f5dc35
parent d90bd831
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -161,10 +161,15 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                    // If there is an active call.
                    if (mForegroundCall.hasConnections()) {
                        ImsCall activeCall = mForegroundCall.getFirstConnection().getImsCall();
                        if (activeCall != null && imsCall != null) {
                            // activeCall could be null if the foreground call is in a disconnected
                            // state.  If either of the calls is null there is no need to check if
                            // one will be disconnected on answer.
                            boolean answeringWillDisconnect =
                                    shouldDisconnectActiveCallOnAnswer(activeCall, imsCall);
                            conn.setActiveCallDisconnectedOnAnswer(answeringWillDisconnect);
                        }
                    }
                    conn.setAllowAddCallDuringVideoCall(mAllowAddCallDuringVideoCall);
                    addConnection(conn);