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

Commit ab4b6d42 authored by hyosun's avatar hyosun Committed by Brad Ebinger
Browse files

Add imsCall#getCallSession() null check in ImsPhoneCallTracker#maybeSetVideoCallProvider.

In case the callSessionUpdated event is triggered after SRVCC completes, add imsCall#getCallSession() null check in ImsPhoneCallTracker#maybeSetVideoCallProvider.

Fixes: 230232974
Test: atest FrameworksTelephonyTests
Change-Id: Iaa3a454edab7f29c376a69aeb788642569fc13c9
parent c3cde513
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -66,6 +66,7 @@ import android.telephony.TelephonyLocalConnection;
import android.telephony.TelephonyManager;
import android.telephony.TelephonyManager;
import android.telephony.emergency.EmergencyNumber;
import android.telephony.emergency.EmergencyNumber;
import android.telephony.ims.ImsCallProfile;
import android.telephony.ims.ImsCallProfile;
import android.telephony.ims.ImsCallSession;
import android.telephony.ims.ImsConferenceState;
import android.telephony.ims.ImsConferenceState;
import android.telephony.ims.ImsMmTelManager;
import android.telephony.ims.ImsMmTelManager;
import android.telephony.ims.ImsReasonInfo;
import android.telephony.ims.ImsReasonInfo;
@@ -2798,7 +2799,9 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {


    private void maybeSetVideoCallProvider(ImsPhoneConnection conn, ImsCall imsCall) {
    private void maybeSetVideoCallProvider(ImsPhoneConnection conn, ImsCall imsCall) {
        android.telecom.Connection.VideoProvider connVideoProvider = conn.getVideoProvider();
        android.telecom.Connection.VideoProvider connVideoProvider = conn.getVideoProvider();
        if (connVideoProvider != null || imsCall.getCallSession().getVideoCallProvider() == null) {
        ImsCallSession callSession = imsCall.getCallSession(); 
        if (connVideoProvider != null || callSession == null
            || callSession.getVideoCallProvider() == null) {
            return;
            return;
        }
        }


+16 −0
Original line number Original line Diff line number Diff line
@@ -1878,6 +1878,22 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest {
        assertEquals(Call.State.IDLE, mCTUT.mForegroundCall.getState());
        assertEquals(Call.State.IDLE, mCTUT.mForegroundCall.getState());
    }
    }


    @Test
    @SmallTest
    public void testCallSessionUpdatedAfterSrvccCompleted() throws RemoteException {
        startOutgoingCall();

        // Move the connection to the handover state.
        mCTUT.notifySrvccState(Call.SrvccState.COMPLETED);

        try {
            // When trigger CallSessionUpdated after Srvcc completes, checking no exception.
            mImsCallListener.onCallUpdated(mSecondImsCall);
        } catch (Exception ex) {
            Assert.fail("unexpected exception thrown" + ex.getMessage());
        }
    }

    private void sendCarrierConfigChanged() {
    private void sendCarrierConfigChanged() {
        Intent intent = new Intent(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED);
        Intent intent = new Intent(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED);
        intent.putExtra(CarrierConfigManager.EXTRA_SUBSCRIPTION_INDEX, mPhone.getSubId());
        intent.putExtra(CarrierConfigManager.EXTRA_SUBSCRIPTION_INDEX, mPhone.getSubId());