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

Commit 68b6108e authored by Ravi Paluri's avatar Ravi Paluri
Browse files

IMS: Propagate local video capabilities as it is

Propagate local video capabilities as it is

Test: Manual
Bug: 129990379
Change-Id: Iec7e4c6fc792aadb43f85a391a90e17b33b942ec
parent a54c3d72
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -1613,14 +1613,6 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        Log.v(this, "setConnectionCapabilities: %s", Connection.capabilitiesToString(
                connectionCapabilities));
        if (forceUpdate || mConnectionCapabilities != connectionCapabilities) {
            // If the phone account does not support video calling, and the connection capabilities
            // passed in indicate that the call supports video, remove those video capabilities.
            if (!isVideoCallingSupportedByPhoneAccount()
                    && doesCallSupportVideo(connectionCapabilities)) {
                Log.w(this, "setConnectionCapabilities: attempt to set connection as video " +
                        "capable when not supported by the phone account.");
                connectionCapabilities = removeVideoCapabilities(connectionCapabilities);
            }
            int previousCapabilities = mConnectionCapabilities;
            mConnectionCapabilities = connectionCapabilities;
            for (Listener l : mListeners) {
+1 −20
Original line number Diff line number Diff line
@@ -1193,28 +1193,9 @@ public class CallsManagerTest extends TelecomTestCase {
        assertTrue((newCapabilities & Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL)
                == Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL);
        assertTrue(ongoingCall.isVideoCallingSupportedByPhoneAccount());

        // Fire a changed event for the phone account making it not capable.
        mCallsManager.getPhoneAccountListener().onPhoneAccountChanged(mPhoneAccountRegistrar,
                SIM_2_ACCOUNT);
        newCapabilities = capabilitiesQueue.poll(TEST_TIMEOUT, TimeUnit.MILLISECONDS);
        assertFalse((newCapabilities & Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL)
                == Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL);
        assertFalse(ongoingCall.isVideoCallingSupportedByPhoneAccount());

        // Fire a change for an unrelated phone account.
        PhoneAccount anotherVideoCapableAcct = new PhoneAccount.Builder(SIM_1_ACCOUNT)
                .setCapabilities(SIM_2_ACCOUNT.getCapabilities()
                        | PhoneAccount.CAPABILITY_VIDEO_CALLING)
                .build();
        mCallsManager.getPhoneAccountListener().onPhoneAccountChanged(mPhoneAccountRegistrar,
                anotherVideoCapableAcct);
        // Call still should not be video capable
        assertFalse((ongoingCall.getConnectionCapabilities()
                & Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL)
                == Connection.CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL);
    }


    private Call addSpyCall() {
        return addSpyCall(SIM_2_HANDLE, CallState.ACTIVE);
    }