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

Commit ddb03e13 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Call "createConnectionComplete" callback in Telecom.

When done creating a connection in Telecom, call createConnectionComplete.
Note: Checks the serviceinterface for null since in the case of a
"null connection" from the ConnectionService we'll be unbound by
the time we get here.

Test: Manual
Bug: 33272455
Change-Id: Ic23f6ad65d49d2a8c70ac4d35d53feb0dd5e34bb
parent 85c04756
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -77,6 +77,15 @@ public class ConnectionServiceWrapper extends ServiceBinder {
                    logIncoming("handleCreateConnectionComplete %s", callId);
                    ConnectionServiceWrapper.this
                            .handleCreateConnectionComplete(callId, request, connection);

                    if (mServiceInterface != null) {
                        logOutgoing("createConnectionComplete %s", callId);
                        try {
                            mServiceInterface.createConnectionComplete(callId,
                                    Log.getExternalSession());
                        } catch (RemoteException e) {
                        }
                    }
                }
            } finally {
                Binder.restoreCallingIdentity(token);
+9 −0
Original line number Diff line number Diff line
@@ -116,6 +116,10 @@ public class ConnectionServiceFixture implements TestFixture<IConnectionService>
            return fakeConnection;
        }

        @Override
        public void onCreateConnectionComplete(Connection connection) {
        }

        @Override
        public void onConference(Connection cxn1, Connection cxn2) {
            if (((FakeConnection) cxn1).getIsConferenceCreated()) {
@@ -239,6 +243,11 @@ public class ConnectionServiceFixture implements TestFixture<IConnectionService>
                    id, request, isIncoming, isUnknown, null /*Session.Info*/);
        }

        @Override
        public void createConnectionComplete(String id, Session.Info info) throws RemoteException {
            mConnectionServiceDelegateAdapter.createConnectionComplete(id, null /*Session.Info*/);
        }

        @Override
        public void createConnectionFailed(PhoneAccountHandle connectionManagerPhoneAccount,
                String callId, ConnectionRequest request, boolean isIncoming,
+10 −0
Original line number Diff line number Diff line
@@ -712,6 +712,10 @@ public class TelecomSystemTest extends TelecomTestCase {
        // Wait for the callback in ConnectionService#onAdapterAttached to execute.
        waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT);

        // Ensure callback to CS on successful creation happened.
        verify(connectionServiceFixture.getTestDouble(), timeout(TEST_TIMEOUT))
                .createConnectionComplete(anyString(), any());

        assertEquals(startingNumCalls + 1, mInCallServiceFixtureX.mCallById.size());
        assertEquals(startingNumCalls + 1, mInCallServiceFixtureY.mCallById.size());

@@ -759,6 +763,12 @@ public class TelecomSystemTest extends TelecomTestCase {

        // Wait for the handler to start the CallerInfo lookup
        waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT);

        // Ensure callback to CS on successful creation happened.
        verify(connectionServiceFixture.getTestDouble(), timeout(TEST_TIMEOUT))
                .createConnectionComplete(anyString(), any());


        // Process the CallerInfo lookup reply
        mCallerInfoAsyncQueryFactoryFixture.mRequests.forEach(
                CallerInfoAsyncQueryFactoryFixture.Request::reply);