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

Commit 36e8e033 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add imsCall#getCallSession() null check in...

Merge "Add imsCall#getCallSession() null check in ImsPhoneCallTracker#maybeSetVideoCallProvider." into tm-dev
parents 955d2927 ab4b6d42
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ import android.telephony.TelephonyLocalConnection;
import android.telephony.TelephonyManager;
import android.telephony.emergency.EmergencyNumber;
import android.telephony.ims.ImsCallProfile;
import android.telephony.ims.ImsCallSession;
import android.telephony.ims.ImsConferenceState;
import android.telephony.ims.ImsMmTelManager;
import android.telephony.ims.ImsReasonInfo;
@@ -2798,7 +2799,9 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {

    private void maybeSetVideoCallProvider(ImsPhoneConnection conn, ImsCall imsCall) {
        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;
        }

+16 −0
Original line number Diff line number Diff line
@@ -1878,6 +1878,22 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest {
        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() {
        Intent intent = new Intent(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED);
        intent.putExtra(CarrierConfigManager.EXTRA_SUBSCRIPTION_INDEX, mPhone.getSubId());