Loading src/com/android/server/telecom/ConnectionServiceWrapper.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -88,6 +88,7 @@ public class ConnectionServiceWrapper extends ServiceBinder implements mServiceInterface.createConnectionComplete(callId, mServiceInterface.createConnectionComplete(callId, Log.getExternalSession()); Log.getExternalSession()); } catch (RemoteException e) { } catch (RemoteException e) { logOutgoing("createConnectionComplete remote exception=%s", e); } } } } } } Loading tests/src/com/android/server/telecom/tests/BasicCallTests.java +13 −0 Original line number Original line Diff line number Diff line Loading @@ -161,6 +161,9 @@ public class BasicCallTests extends TelecomSystemTest { .getApplicationContext().getSystemService(Context.TELECOM_SERVICE); .getApplicationContext().getSystemService(Context.TELECOM_SERVICE); telecomManager.acceptRingingCall(); telecomManager.acceptRingingCall(); waitForHandlerAction(mTelecomSystem.getCallsManager() .getConnectionServiceFocusManager().getHandler(), TEST_TIMEOUT); verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT)) verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT)) .answer(eq(ids.mConnectionId), any()); .answer(eq(ids.mConnectionId), any()); mConnectionServiceFixtureA.sendSetActive(ids.mConnectionId); mConnectionServiceFixtureA.sendSetActive(ids.mConnectionId); Loading Loading @@ -217,6 +220,9 @@ public class BasicCallTests extends TelecomSystemTest { .getApplicationContext().getSystemService(Context.TELECOM_SERVICE); .getApplicationContext().getSystemService(Context.TELECOM_SERVICE); telecomManager.acceptRingingCall(VideoProfile.STATE_AUDIO_ONLY); telecomManager.acceptRingingCall(VideoProfile.STATE_AUDIO_ONLY); waitForHandlerAction(mTelecomSystem.getCallsManager() .getConnectionServiceFocusManager().getHandler(), TEST_TIMEOUT); // The generic answer method on the ConnectionService is used to answer audio-only calls. // The generic answer method on the ConnectionService is used to answer audio-only calls. verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT)) verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT)) .answer(eq(ids.mConnectionId), any()); .answer(eq(ids.mConnectionId), any()); Loading Loading @@ -246,6 +252,9 @@ public class BasicCallTests extends TelecomSystemTest { .getApplicationContext().getSystemService(Context.TELECOM_SERVICE); .getApplicationContext().getSystemService(Context.TELECOM_SERVICE); telecomManager.acceptRingingCall(999 /* invalid videostate */); telecomManager.acceptRingingCall(999 /* invalid videostate */); waitForHandlerAction(mTelecomSystem.getCallsManager() .getConnectionServiceFocusManager().getHandler(), TEST_TIMEOUT); // Answer video API should be called // Answer video API should be called verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT)) verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT)) .answerVideo(eq(ids.mConnectionId), eq(VideoProfile.STATE_BIDIRECTIONAL), any()); .answerVideo(eq(ids.mConnectionId), eq(VideoProfile.STATE_BIDIRECTIONAL), any()); Loading Loading @@ -621,6 +630,10 @@ public class BasicCallTests extends TelecomSystemTest { mConnectionServiceFixtureA. mConnectionServiceFixtureA. sendSetDisconnected(outgoing.mConnectionId, DisconnectCause.REMOTE); sendSetDisconnected(outgoing.mConnectionId, DisconnectCause.REMOTE); waitForHandlerAction(mTelecomSystem.getCallsManager().getCallAudioManager() .getCallAudioModeStateMachine().getHandler(), TEST_TIMEOUT); waitForHandlerAction(mTelecomSystem.getCallsManager().getCallAudioManager() .getCallAudioRouteStateMachine().getHandler(), TEST_TIMEOUT); verify(audioManager, timeout(TEST_TIMEOUT)) verify(audioManager, timeout(TEST_TIMEOUT)) .abandonAudioFocusForCall(); .abandonAudioFocusForCall(); verify(audioManager, timeout(TEST_TIMEOUT).atLeastOnce()) verify(audioManager, timeout(TEST_TIMEOUT).atLeastOnce()) Loading tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -249,6 +249,7 @@ public class ConnectionServiceFixture implements TestFixture<IConnectionService> @Override @Override public void createConnectionComplete(String id, Session.Info info) throws RemoteException { public void createConnectionComplete(String id, Session.Info info) throws RemoteException { Log.i(ConnectionServiceFixture.this, "createConnectionComplete: %s", id); mConnectionServiceDelegateAdapter.createConnectionComplete(id, null /*Session.Info*/); mConnectionServiceDelegateAdapter.createConnectionComplete(id, null /*Session.Info*/); } } Loading tests/src/com/android/server/telecom/tests/TelecomSystemTest.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -925,7 +925,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); // Wait a few more times to address flakiness due to timing issues. waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT); waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT); // Ensure callback to CS on successful creation happened. // Ensure callback to CS on successful creation happened. verify(connectionServiceFixture.getTestDouble(), timeout(TEST_TIMEOUT)) verify(connectionServiceFixture.getTestDouble(), timeout(TEST_TIMEOUT)) .createConnectionComplete(anyString(), any()); .createConnectionComplete(anyString(), any()); Loading Loading
src/com/android/server/telecom/ConnectionServiceWrapper.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -88,6 +88,7 @@ public class ConnectionServiceWrapper extends ServiceBinder implements mServiceInterface.createConnectionComplete(callId, mServiceInterface.createConnectionComplete(callId, Log.getExternalSession()); Log.getExternalSession()); } catch (RemoteException e) { } catch (RemoteException e) { logOutgoing("createConnectionComplete remote exception=%s", e); } } } } } } Loading
tests/src/com/android/server/telecom/tests/BasicCallTests.java +13 −0 Original line number Original line Diff line number Diff line Loading @@ -161,6 +161,9 @@ public class BasicCallTests extends TelecomSystemTest { .getApplicationContext().getSystemService(Context.TELECOM_SERVICE); .getApplicationContext().getSystemService(Context.TELECOM_SERVICE); telecomManager.acceptRingingCall(); telecomManager.acceptRingingCall(); waitForHandlerAction(mTelecomSystem.getCallsManager() .getConnectionServiceFocusManager().getHandler(), TEST_TIMEOUT); verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT)) verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT)) .answer(eq(ids.mConnectionId), any()); .answer(eq(ids.mConnectionId), any()); mConnectionServiceFixtureA.sendSetActive(ids.mConnectionId); mConnectionServiceFixtureA.sendSetActive(ids.mConnectionId); Loading Loading @@ -217,6 +220,9 @@ public class BasicCallTests extends TelecomSystemTest { .getApplicationContext().getSystemService(Context.TELECOM_SERVICE); .getApplicationContext().getSystemService(Context.TELECOM_SERVICE); telecomManager.acceptRingingCall(VideoProfile.STATE_AUDIO_ONLY); telecomManager.acceptRingingCall(VideoProfile.STATE_AUDIO_ONLY); waitForHandlerAction(mTelecomSystem.getCallsManager() .getConnectionServiceFocusManager().getHandler(), TEST_TIMEOUT); // The generic answer method on the ConnectionService is used to answer audio-only calls. // The generic answer method on the ConnectionService is used to answer audio-only calls. verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT)) verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT)) .answer(eq(ids.mConnectionId), any()); .answer(eq(ids.mConnectionId), any()); Loading Loading @@ -246,6 +252,9 @@ public class BasicCallTests extends TelecomSystemTest { .getApplicationContext().getSystemService(Context.TELECOM_SERVICE); .getApplicationContext().getSystemService(Context.TELECOM_SERVICE); telecomManager.acceptRingingCall(999 /* invalid videostate */); telecomManager.acceptRingingCall(999 /* invalid videostate */); waitForHandlerAction(mTelecomSystem.getCallsManager() .getConnectionServiceFocusManager().getHandler(), TEST_TIMEOUT); // Answer video API should be called // Answer video API should be called verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT)) verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT)) .answerVideo(eq(ids.mConnectionId), eq(VideoProfile.STATE_BIDIRECTIONAL), any()); .answerVideo(eq(ids.mConnectionId), eq(VideoProfile.STATE_BIDIRECTIONAL), any()); Loading Loading @@ -621,6 +630,10 @@ public class BasicCallTests extends TelecomSystemTest { mConnectionServiceFixtureA. mConnectionServiceFixtureA. sendSetDisconnected(outgoing.mConnectionId, DisconnectCause.REMOTE); sendSetDisconnected(outgoing.mConnectionId, DisconnectCause.REMOTE); waitForHandlerAction(mTelecomSystem.getCallsManager().getCallAudioManager() .getCallAudioModeStateMachine().getHandler(), TEST_TIMEOUT); waitForHandlerAction(mTelecomSystem.getCallsManager().getCallAudioManager() .getCallAudioRouteStateMachine().getHandler(), TEST_TIMEOUT); verify(audioManager, timeout(TEST_TIMEOUT)) verify(audioManager, timeout(TEST_TIMEOUT)) .abandonAudioFocusForCall(); .abandonAudioFocusForCall(); verify(audioManager, timeout(TEST_TIMEOUT).atLeastOnce()) verify(audioManager, timeout(TEST_TIMEOUT).atLeastOnce()) Loading
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -249,6 +249,7 @@ public class ConnectionServiceFixture implements TestFixture<IConnectionService> @Override @Override public void createConnectionComplete(String id, Session.Info info) throws RemoteException { public void createConnectionComplete(String id, Session.Info info) throws RemoteException { Log.i(ConnectionServiceFixture.this, "createConnectionComplete: %s", id); mConnectionServiceDelegateAdapter.createConnectionComplete(id, null /*Session.Info*/); mConnectionServiceDelegateAdapter.createConnectionComplete(id, null /*Session.Info*/); } } Loading
tests/src/com/android/server/telecom/tests/TelecomSystemTest.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -925,7 +925,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); // Wait a few more times to address flakiness due to timing issues. waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT); waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT); // Ensure callback to CS on successful creation happened. // Ensure callback to CS on successful creation happened. verify(connectionServiceFixture.getTestDouble(), timeout(TEST_TIMEOUT)) verify(connectionServiceFixture.getTestDouble(), timeout(TEST_TIMEOUT)) .createConnectionComplete(anyString(), any()); .createConnectionComplete(anyString(), any()); Loading