Modify AIDLs to include Session.Info
Modifies the IConnectionService.aidl file to include Session.Info
information to pass from Telecom to Telephony, which is used to start
external Sessions in Telephony from Telecom.
Test: Manual testing and Unit Tests pass
Bug: 26571395
Change-Id: I587c5218da86585d23650d056f32197d7afaecce
diff --git a/src/com/android/server/telecom/ConnectionServiceWrapper.java b/src/com/android/server/telecom/ConnectionServiceWrapper.java
index 1feb8bc..d8c698a 100644
--- a/src/com/android/server/telecom/ConnectionServiceWrapper.java
+++ b/src/com/android/server/telecom/ConnectionServiceWrapper.java
@@ -31,6 +31,7 @@
import android.telecom.DisconnectCause;
import android.telecom.GatewayInfo;
import android.telecom.Log;
+import android.telecom.Logging.Session;
import android.telecom.ParcelableConference;
import android.telecom.ParcelableConnection;
import android.telecom.PhoneAccountHandle;
@@ -687,7 +688,7 @@
if (isServiceValid("addConnectionServiceAdapter")) {
try {
logOutgoing("addConnectionServiceAdapter %s", adapter);
- mServiceInterface.addConnectionServiceAdapter(adapter);
+ mServiceInterface.addConnectionServiceAdapter(adapter, Log.getExternalSession());
} catch (RemoteException e) {
}
}
@@ -698,7 +699,7 @@
if (isServiceValid("removeConnectionServiceAdapter")) {
try {
logOutgoing("removeConnectionServiceAdapter %s", adapter);
- mServiceInterface.removeConnectionServiceAdapter(adapter);
+ mServiceInterface.removeConnectionServiceAdapter(adapter, Log.getExternalSession());
} catch (RemoteException e) {
}
}
@@ -741,7 +742,8 @@
call.getVideoState(),
callId),
call.shouldAttachToExistingConnection(),
- call.isUnknown());
+ call.isUnknown(),
+ Log.getExternalSession());
} catch (RemoteException e) {
Log.e(this, e, "Failure to createConnection -- %s", getComponentName());
mPendingResponses.remove(callId).handleCreateConnectionFailure(
@@ -759,7 +761,7 @@
mBinder.bind(callback, call);
}
- /** @see IConnectionService#abort(String) */
+ /** @see IConnectionService#abort(String, Session.Info) */
void abort(Call call) {
// Clear out any pending outgoing call data
final String callId = mCallIdMapper.getCallId(call);
@@ -768,7 +770,7 @@
if (callId != null && isServiceValid("abort")) {
try {
logOutgoing("abort %s", callId);
- mServiceInterface.abort(callId);
+ mServiceInterface.abort(callId, Log.getExternalSession());
} catch (RemoteException e) {
}
}
@@ -776,84 +778,85 @@
removeCall(call, new DisconnectCause(DisconnectCause.LOCAL));
}
- /** @see IConnectionService#silence(String) */
+ /** @see IConnectionService#silence(String, Session.Info) */
void silence(Call call) {
final String callId = mCallIdMapper.getCallId(call);
if (callId != null && isServiceValid("silence")) {
try {
logOutgoing("silence %s", callId);
- mServiceInterface.silence(callId);
+ mServiceInterface.silence(callId, Log.getExternalSession());
} catch (RemoteException e) {
}
}
}
- /** @see IConnectionService#hold(String) */
+ /** @see IConnectionService#hold(String, Session.Info) */
void hold(Call call) {
final String callId = mCallIdMapper.getCallId(call);
if (callId != null && isServiceValid("hold")) {
try {
logOutgoing("hold %s", callId);
- mServiceInterface.hold(callId);
+ mServiceInterface.hold(callId, Log.getExternalSession());
} catch (RemoteException e) {
}
}
}
- /** @see IConnectionService#unhold(String) */
+ /** @see IConnectionService#unhold(String, Session.Info) */
void unhold(Call call) {
final String callId = mCallIdMapper.getCallId(call);
if (callId != null && isServiceValid("unhold")) {
try {
logOutgoing("unhold %s", callId);
- mServiceInterface.unhold(callId);
+ mServiceInterface.unhold(callId, Log.getExternalSession());
} catch (RemoteException e) {
}
}
}
- /** @see IConnectionService#onCallAudioStateChanged(String, CallAudioState) */
+ /** @see IConnectionService#onCallAudioStateChanged(String, CallAudioState, Session.Info) */
@VisibleForTesting
public void onCallAudioStateChanged(Call activeCall, CallAudioState audioState) {
final String callId = mCallIdMapper.getCallId(activeCall);
if (callId != null && isServiceValid("onCallAudioStateChanged")) {
try {
logOutgoing("onCallAudioStateChanged %s %s", callId, audioState);
- mServiceInterface.onCallAudioStateChanged(callId, audioState);
+ mServiceInterface.onCallAudioStateChanged(callId, audioState,
+ Log.getExternalSession());
} catch (RemoteException e) {
}
}
}
- /** @see IConnectionService#disconnect(String) */
+ /** @see IConnectionService#disconnect(String, Session.Info) */
void disconnect(Call call) {
final String callId = mCallIdMapper.getCallId(call);
if (callId != null && isServiceValid("disconnect")) {
try {
logOutgoing("disconnect %s", callId);
- mServiceInterface.disconnect(callId);
+ mServiceInterface.disconnect(callId, Log.getExternalSession());
} catch (RemoteException e) {
}
}
}
- /** @see IConnectionService#answer(String) */
+ /** @see IConnectionService#answer(String, Session.Info) */
void answer(Call call, int videoState) {
final String callId = mCallIdMapper.getCallId(call);
if (callId != null && isServiceValid("answer")) {
try {
logOutgoing("answer %s %d", callId, videoState);
if (VideoProfile.isAudioOnly(videoState)) {
- mServiceInterface.answer(callId);
+ mServiceInterface.answer(callId, Log.getExternalSession());
} else {
- mServiceInterface.answerVideo(callId, videoState);
+ mServiceInterface.answerVideo(callId, videoState, Log.getExternalSession());
}
} catch (RemoteException e) {
}
}
}
- /** @see IConnectionService#reject(String) */
+ /** @see IConnectionService#reject(String, Session.Info) */
void reject(Call call, boolean rejectWithMessage, String message) {
final String callId = mCallIdMapper.getCallId(call);
if (callId != null && isServiceValid("reject")) {
@@ -862,34 +865,34 @@
if (rejectWithMessage && call.can(
Connection.CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION)) {
- mServiceInterface.rejectWithMessage(callId, message);
+ mServiceInterface.rejectWithMessage(callId, message, Log.getExternalSession());
} else {
- mServiceInterface.reject(callId);
+ mServiceInterface.reject(callId, Log.getExternalSession());
}
} catch (RemoteException e) {
}
}
}
- /** @see IConnectionService#playDtmfTone(String, char) */
+ /** @see IConnectionService#playDtmfTone(String, char, Session.Info) */
void playDtmfTone(Call call, char digit) {
final String callId = mCallIdMapper.getCallId(call);
if (callId != null && isServiceValid("playDtmfTone")) {
try {
logOutgoing("playDtmfTone %s %c", callId, digit);
- mServiceInterface.playDtmfTone(callId, digit);
+ mServiceInterface.playDtmfTone(callId, digit, Log.getExternalSession());
} catch (RemoteException e) {
}
}
}
- /** @see IConnectionService#stopDtmfTone(String) */
+ /** @see IConnectionService#stopDtmfTone(String, Session.Info) */
void stopDtmfTone(Call call) {
final String callId = mCallIdMapper.getCallId(call);
if (callId != null && isServiceValid("stopDtmfTone")) {
try {
logOutgoing("stopDtmfTone %s", callId);
- mServiceInterface.stopDtmfTone(callId);
+ mServiceInterface.stopDtmfTone(callId, Log.getExternalSession());
} catch (RemoteException e) {
}
}
@@ -936,7 +939,7 @@
if (callId != null && isServiceValid("onPostDialContinue")) {
try {
logOutgoing("onPostDialContinue %s %b", callId, proceed);
- mServiceInterface.onPostDialContinue(callId, proceed);
+ mServiceInterface.onPostDialContinue(callId, proceed, Log.getExternalSession());
} catch (RemoteException ignored) {
}
}
@@ -948,7 +951,7 @@
if (callId != null && otherCallId != null && isServiceValid("conference")) {
try {
logOutgoing("conference %s %s", callId, otherCallId);
- mServiceInterface.conference(callId, otherCallId);
+ mServiceInterface.conference(callId, otherCallId, Log.getExternalSession());
} catch (RemoteException ignored) {
}
}
@@ -959,7 +962,7 @@
if (callId != null && isServiceValid("splitFromConference")) {
try {
logOutgoing("splitFromConference %s", callId);
- mServiceInterface.splitFromConference(callId);
+ mServiceInterface.splitFromConference(callId, Log.getExternalSession());
} catch (RemoteException ignored) {
}
}
@@ -970,7 +973,7 @@
if (callId != null && isServiceValid("mergeConference")) {
try {
logOutgoing("mergeConference %s", callId);
- mServiceInterface.mergeConference(callId);
+ mServiceInterface.mergeConference(callId, Log.getExternalSession());
} catch (RemoteException ignored) {
}
}
@@ -981,7 +984,7 @@
if (callId != null && isServiceValid("swapConference")) {
try {
logOutgoing("swapConference %s", callId);
- mServiceInterface.swapConference(callId);
+ mServiceInterface.swapConference(callId, Log.getExternalSession());
} catch (RemoteException ignored) {
}
}
@@ -992,7 +995,7 @@
if (callId != null && isServiceValid("pullExternalCall")) {
try {
logOutgoing("pullExternalCall %s", callId);
- mServiceInterface.pullExternalCall(callId);
+ mServiceInterface.pullExternalCall(callId, Log.getExternalSession());
} catch (RemoteException ignored) {
}
}
@@ -1003,7 +1006,7 @@
if (callId != null && isServiceValid("sendCallEvent")) {
try {
logOutgoing("sendCallEvent %s %s", callId, event);
- mServiceInterface.sendCallEvent(callId, event, extras);
+ mServiceInterface.sendCallEvent(callId, event, extras, Log.getExternalSession());
} catch (RemoteException ignored) {
}
}
@@ -1014,7 +1017,7 @@
if (callId != null && isServiceValid("onExtrasChanged")) {
try {
logOutgoing("onExtrasChanged %s %s", callId, extras);
- mServiceInterface.onExtrasChanged(callId, extras);
+ mServiceInterface.onExtrasChanged(callId, extras, Log.getExternalSession());
} catch (RemoteException ignored) {
}
}
diff --git a/tests/src/com/android/server/telecom/tests/BasicCallTests.java b/tests/src/com/android/server/telecom/tests/BasicCallTests.java
index 8bd5302..92ec515 100644
--- a/tests/src/com/android/server/telecom/tests/BasicCallTests.java
+++ b/tests/src/com/android/server/telecom/tests/BasicCallTests.java
@@ -137,7 +137,7 @@
telecomManager.acceptRingingCall();
verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT))
- .answer(ids.mConnectionId);
+ .answer(eq(ids.mConnectionId), any());
mConnectionServiceFixtureA.sendSetActive(ids.mConnectionId);
mInCallServiceFixtureX.mInCallAdapter.disconnectCall(ids.mCallId);
@@ -165,7 +165,7 @@
// Answer video API should be called
verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT))
- .answerVideo(eq(ids.mConnectionId), eq(VideoProfile.STATE_BIDIRECTIONAL));
+ .answerVideo(eq(ids.mConnectionId), eq(VideoProfile.STATE_BIDIRECTIONAL), any());
mConnectionServiceFixtureA.sendSetActive(ids.mConnectionId);
mInCallServiceFixtureX.mInCallAdapter.disconnectCall(ids.mCallId);
@@ -192,7 +192,7 @@
// The generic answer method on the ConnectionService is used to answer audio-only calls.
verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT))
- .answer(eq(ids.mConnectionId));
+ .answer(eq(ids.mConnectionId), any());
mConnectionServiceFixtureA.sendSetActive(ids.mConnectionId);
mInCallServiceFixtureX.mInCallAdapter.disconnectCall(ids.mCallId);
@@ -220,7 +220,7 @@
// Answer video API should be called
verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT))
- .answerVideo(eq(ids.mConnectionId), eq(VideoProfile.STATE_BIDIRECTIONAL));
+ .answerVideo(eq(ids.mConnectionId), eq(VideoProfile.STATE_BIDIRECTIONAL), any());
mConnectionServiceFixtureA.sendSetActive(ids.mConnectionId);
mInCallServiceFixtureX.mInCallAdapter.disconnectCall(ids.mCallId);
}
@@ -291,7 +291,7 @@
waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT);
verify(mConnectionServiceFixtureA.getTestDouble())
.createConnection(any(PhoneAccountHandle.class), anyString(),
- any(ConnectionRequest.class), eq(true), eq(false));
+ any(ConnectionRequest.class), eq(true), eq(false), any());
waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT);
assertEquals(1, mCallerInfoAsyncQueryFactoryFixture.mRequests.size());
@@ -333,7 +333,7 @@
waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT);
verify(mConnectionServiceFixtureA.getTestDouble())
.createConnection(any(PhoneAccountHandle.class), anyString(),
- any(ConnectionRequest.class), eq(true), eq(false));
+ any(ConnectionRequest.class), eq(true), eq(false), any());
waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT);
// Never reply to the caller info lookup.
@@ -378,7 +378,7 @@
waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT);
verify(mConnectionServiceFixtureA.getTestDouble())
.createConnection(any(PhoneAccountHandle.class), anyString(),
- any(ConnectionRequest.class), eq(true), eq(false));
+ any(ConnectionRequest.class), eq(true), eq(false), any());
waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT);
assertEquals(1, mCallerInfoAsyncQueryFactoryFixture.mRequests.size());
@@ -482,7 +482,7 @@
IdPair incoming = startAndMakeActiveIncomingCall("650-555-2323",
mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
verify(mConnectionServiceFixtureA.getTestDouble())
- .hold(outgoing.mConnectionId);
+ .hold(eq(outgoing.mConnectionId), any());
mConnectionServiceFixtureA.mConnectionById.get(outgoing.mConnectionId).state =
Connection.STATE_HOLDING;
mConnectionServiceFixtureA.sendSetOnHold(outgoing.mConnectionId);
@@ -612,11 +612,11 @@
mInCallServiceFixtureX.mInCallAdapter.pullExternalCall(ids.mCallId);
Thread.sleep(TEST_TIMEOUT);
verify(mConnectionServiceFixtureA.getTestDouble(), never())
- .pullExternalCall(ids.mCallId);
+ .pullExternalCall(eq(ids.mCallId), any());
}
/**
- * Tests the {@link Connection#sendConnectionEvent(String)} API.
+ * Tests the {@link Connection#sendConnectionEvent(String, Bundle)} API.
*
* @throws Exception
*/
@@ -631,7 +631,7 @@
}
/**
- * Tests the {@link Connection#sendConnectionEvent(String)} API.
+ * Tests the {@link Connection#sendConnectionEvent(String, Bundle)} API.
*
* @throws Exception
*/
@@ -664,7 +664,7 @@
mInCallServiceFixtureX.mInCallAdapter.sendCallEvent(ids.mCallId, TEST_EVENT, null);
verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT))
- .sendCallEvent(ids.mConnectionId, TEST_EVENT, null);
+ .sendCallEvent(eq(ids.mConnectionId), eq(TEST_EVENT), isNull(Bundle.class), any());
}
/**
@@ -686,7 +686,7 @@
testBundle);
verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT))
.sendCallEvent(eq(ids.mConnectionId), eq(TEST_EVENT),
- bundleArgumentCaptor.capture());
+ bundleArgumentCaptor.capture(), any());
assert (bundleArgumentCaptor.getValue().containsKey(TEST_BUNDLE_KEY));
}
@@ -870,7 +870,7 @@
// Attempt to pull the call and verify the API call makes it through
mInCallServiceFixtureX.mInCallAdapter.pullExternalCall(ids.mCallId);
verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT))
- .pullExternalCall(ids.mConnectionId);
+ .pullExternalCall(eq(ids.mConnectionId), any());
}
/**
@@ -895,7 +895,7 @@
mInCallServiceFixtureX.mInCallAdapter.pullExternalCall(ids.mCallId);
Thread.sleep(TEST_TIMEOUT);
verify(mConnectionServiceFixtureA.getTestDouble(), never())
- .pullExternalCall(ids.mConnectionId);
+ .pullExternalCall(eq(ids.mConnectionId), any());
}
@LargeTest
diff --git a/tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java b/tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
index a0e0e0f..32cb54a 100644
--- a/tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
+++ b/tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
@@ -38,6 +38,7 @@
import android.telecom.ConnectionService;
import android.telecom.DisconnectCause;
import android.telecom.Log;
+import android.telecom.Logging.Session;
import android.telecom.ParcelableConference;
import android.telecom.ParcelableConnection;
import android.telecom.PhoneAccountHandle;
@@ -165,28 +166,29 @@
List<String> rejectedCallIds = Lists.newArrayList();
@Override
- public void addConnectionServiceAdapter(IConnectionServiceAdapter adapter)
- throws RemoteException {
+ public void addConnectionServiceAdapter(IConnectionServiceAdapter adapter,
+ Session.Info info) throws RemoteException {
if (!mConnectionServiceAdapters.add(adapter)) {
throw new RuntimeException("Adapter already added: " + adapter);
}
- mConnectionServiceDelegateAdapter.addConnectionServiceAdapter(adapter);
+ mConnectionServiceDelegateAdapter.addConnectionServiceAdapter(adapter,
+ null /*Session.Info*/);
}
@Override
- public void removeConnectionServiceAdapter(IConnectionServiceAdapter adapter)
- throws RemoteException {
+ public void removeConnectionServiceAdapter(IConnectionServiceAdapter adapter,
+ Session.Info info) throws RemoteException {
if (!mConnectionServiceAdapters.remove(adapter)) {
throw new RuntimeException("Adapter never added: " + adapter);
}
- mConnectionServiceDelegateAdapter.removeConnectionServiceAdapter(adapter);
+ mConnectionServiceDelegateAdapter.removeConnectionServiceAdapter(adapter,
+ null /*Session.Info*/);
}
@Override
public void createConnection(PhoneAccountHandle connectionManagerPhoneAccount,
- String id,
- ConnectionRequest request, boolean isIncoming, boolean isUnknown)
- throws RemoteException {
+ String id, ConnectionRequest request, boolean isIncoming, boolean isUnknown,
+ Session.Info info) throws RemoteException {
Log.i(ConnectionServiceFixture.this, "xoxox createConnection --> " + id);
if (mConnectionById.containsKey(id)) {
@@ -205,74 +207,84 @@
c.videoProvider = c.mockVideoProvider.getInterface();
mConnectionById.put(id, c);
mConnectionServiceDelegateAdapter.createConnection(connectionManagerPhoneAccount,
- id, request, isIncoming, isUnknown);
+ id, request, isIncoming, isUnknown, null /*Session.Info*/);
}
@Override
- public void abort(String callId) throws RemoteException { }
+ public void abort(String callId, Session.Info info) throws RemoteException { }
@Override
- public void answerVideo(String callId, int videoState) throws RemoteException { }
+ public void answerVideo(String callId, int videoState,
+ Session.Info info) throws RemoteException { }
@Override
- public void answer(String callId) throws RemoteException { }
+ public void answer(String callId, Session.Info info) throws RemoteException { }
@Override
- public void reject(String callId) throws RemoteException {
+ public void reject(String callId, Session.Info info) throws RemoteException {
rejectedCallIds.add(callId);
}
@Override
- public void rejectWithMessage(String callId, String message) throws RemoteException { }
+ public void rejectWithMessage(String callId, String message,
+ Session.Info info) throws RemoteException { }
@Override
- public void disconnect(String callId) throws RemoteException { }
+ public void disconnect(String callId, Session.Info info) throws RemoteException { }
@Override
- public void silence(String callId) throws RemoteException { }
+ public void silence(String callId, Session.Info info) throws RemoteException { }
@Override
- public void hold(String callId) throws RemoteException { }
+ public void hold(String callId, Session.Info info) throws RemoteException { }
@Override
- public void unhold(String callId) throws RemoteException { }
+ public void unhold(String callId, Session.Info info) throws RemoteException { }
@Override
- public void onCallAudioStateChanged(String activeCallId, CallAudioState audioState)
+ public void onCallAudioStateChanged(String activeCallId, CallAudioState audioState,
+ Session.Info info)
throws RemoteException { }
@Override
- public void playDtmfTone(String callId, char digit) throws RemoteException { }
+ public void playDtmfTone(String callId, char digit,
+ Session.Info info) throws RemoteException { }
@Override
- public void stopDtmfTone(String callId) throws RemoteException { }
+ public void stopDtmfTone(String callId, Session.Info info) throws RemoteException { }
@Override
- public void conference(String conferenceCallId, String callId) throws RemoteException {
- mConnectionServiceDelegateAdapter.conference(conferenceCallId, callId);
+ public void conference(String conferenceCallId, String callId,
+ Session.Info info) throws RemoteException {
+ mConnectionServiceDelegateAdapter.conference(conferenceCallId, callId, info);
}
@Override
- public void splitFromConference(String callId) throws RemoteException { }
+ public void splitFromConference(String callId, Session.Info info) throws RemoteException { }
@Override
- public void mergeConference(String conferenceCallId) throws RemoteException { }
+ public void mergeConference(String conferenceCallId,
+ Session.Info info) throws RemoteException { }
@Override
- public void swapConference(String conferenceCallId) throws RemoteException { }
+ public void swapConference(String conferenceCallId,
+ Session.Info info) throws RemoteException { }
@Override
- public void onPostDialContinue(String callId, boolean proceed) throws RemoteException { }
+ public void onPostDialContinue(String callId, boolean proceed,
+ Session.Info info) throws RemoteException { }
@Override
- public void pullExternalCall(String callId) throws RemoteException { }
+ public void pullExternalCall(String callId, Session.Info info) throws RemoteException { }
@Override
- public void sendCallEvent(String callId, String event, Bundle extras) throws RemoteException
+ public void sendCallEvent(String callId, String event, Bundle extras,
+ Session.Info info) throws RemoteException
{}
- public void onExtrasChanged(String callId, Bundle extras) throws RemoteException {
- mConnectionServiceDelegateAdapter.onExtrasChanged(callId, extras);
+ public void onExtrasChanged(String callId, Bundle extras,
+ Session.Info info) throws RemoteException {
+ mConnectionServiceDelegateAdapter.onExtrasChanged(callId, extras, info);
}
@Override
diff --git a/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java b/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java
index bf78254..d4fd8e3 100644
--- a/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java
+++ b/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java
@@ -645,7 +645,7 @@
verify(connectionServiceFixture.getTestDouble())
.createConnection(eq(phoneAccountHandle), anyString(), any(ConnectionRequest.class),
- eq(false)/*isIncoming*/, anyBoolean());
+ eq(false)/*isIncoming*/, anyBoolean(), any());
// Wait for handleCreateConnectionComplete
waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT);
@@ -667,9 +667,11 @@
verify(connectionServiceFixture.getTestDouble())
.createConnection(eq(phoneAccountHandle), anyString(), any(ConnectionRequest.class),
- anyBoolean(), anyBoolean());
- connectionServiceFixture.sendHandleCreateConnectionComplete(
- connectionServiceFixture.mLatestConnectionId);
+ eq(false)/*isIncoming*/, anyBoolean(), any());
+ // Wait for handleCreateConnectionComplete
+ waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT);
+ // Wait for the callback in ConnectionService#onAdapterAttached to execute.
+ waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT);
assertEquals(startingNumCalls + 1, mInCallServiceFixtureX.mCallById.size());
assertEquals(startingNumCalls + 1, mInCallServiceFixtureY.mCallById.size());
@@ -714,7 +716,7 @@
verify(connectionServiceFixture.getTestDouble())
.createConnection(any(PhoneAccountHandle.class), anyString(),
- any(ConnectionRequest.class), eq(true), eq(false));
+ any(ConnectionRequest.class), eq(true), eq(false), any());
for (CallerInfoAsyncQueryFactoryFixture.Request request :
mCallerInfoAsyncQueryFactoryFixture.mRequests) {
@@ -844,10 +846,10 @@
if (!VideoProfile.isVideo(videoState)) {
verify(connectionServiceFixture.getTestDouble())
- .answer(ids.mConnectionId);
+ .answer(eq(ids.mConnectionId), any());
} else {
verify(connectionServiceFixture.getTestDouble())
- .answerVideo(ids.mConnectionId, videoState);
+ .answerVideo(eq(ids.mConnectionId), eq(videoState), any());
}
connectionServiceFixture.sendSetActive(ids.mConnectionId);