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

Commit 9b02bddd 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

am: ee174c58

Change-Id: Ief4bcab9056f635ff72f19835c8cf63b4bc27143
parents 20a487da ee174c58
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -77,6 +77,15 @@ public class ConnectionServiceWrapper extends ServiceBinder {
                    logIncoming("handleCreateConnectionComplete %s", callId);
                    logIncoming("handleCreateConnectionComplete %s", callId);
                    ConnectionServiceWrapper.this
                    ConnectionServiceWrapper.this
                            .handleCreateConnectionComplete(callId, request, connection);
                            .handleCreateConnectionComplete(callId, request, connection);

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


        @Override
        public void onCreateConnectionComplete(Connection connection) {
        }

        @Override
        @Override
        public void onConference(Connection cxn1, Connection cxn2) {
        public void onConference(Connection cxn1, Connection cxn2) {
            if (((FakeConnection) cxn1).getIsConferenceCreated()) {
            if (((FakeConnection) cxn1).getIsConferenceCreated()) {
@@ -239,6 +243,11 @@ public class ConnectionServiceFixture implements TestFixture<IConnectionService>
                    id, request, isIncoming, isUnknown, null /*Session.Info*/);
                    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
        @Override
        public void createConnectionFailed(PhoneAccountHandle connectionManagerPhoneAccount,
        public void createConnectionFailed(PhoneAccountHandle connectionManagerPhoneAccount,
                String callId, ConnectionRequest request, boolean isIncoming,
                String callId, ConnectionRequest request, boolean isIncoming,
+10 −0
Original line number Original line Diff line number Diff line
@@ -712,6 +712,10 @@ public class TelecomSystemTest extends TelecomTestCase {
        // Wait for the callback in ConnectionService#onAdapterAttached to execute.
        // Wait for the callback in ConnectionService#onAdapterAttached to execute.
        waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT);
        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, mInCallServiceFixtureX.mCallById.size());
        assertEquals(startingNumCalls + 1, mInCallServiceFixtureY.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
        // Wait for the handler to start the CallerInfo lookup
        waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT);
        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
        // Process the CallerInfo lookup reply
        mCallerInfoAsyncQueryFactoryFixture.mRequests.forEach(
        mCallerInfoAsyncQueryFactoryFixture.mRequests.forEach(
                CallerInfoAsyncQueryFactoryFixture.Request::reply);
                CallerInfoAsyncQueryFactoryFixture.Request::reply);