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

Commit ee174c58 authored by Tyler Gunn's avatar Tyler Gunn Committed by android-build-merger
Browse files

Merge "Call "createConnectionComplete" callback in Telecom." into oc-dev

am: 1fc35b9d

Change-Id: I5c943ab3595914bef1861edce25c5692c71f2250
parents 4c9c02de 1fc35b9d
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
@@ -732,6 +732,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());

@@ -779,6 +783,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);