Fix mocked InCallService in unit tests.
The InCallServiceFixture essentially mocks what the actual InCallService
does for portions of the Telecom unit tests. Its implementation did not
actually match how the real InCallService class works.
Updates for calls which don't exist should just be ignored since when the
call is actually added later, the entire call state gets updated.
The likely root cause of this is a change to Telecom to pass along a new
property on calls, which just happens to exercise this code path.
Bug: 118881291
Test: Run telecom tests.
Change-Id: Ie53313ce647a737732bae267a59c619a89036936
diff --git a/tests/src/com/android/server/telecom/tests/InCallServiceFixture.java b/tests/src/com/android/server/telecom/tests/InCallServiceFixture.java
index 69fcdd8..d114cb8 100644
--- a/tests/src/com/android/server/telecom/tests/InCallServiceFixture.java
+++ b/tests/src/com/android/server/telecom/tests/InCallServiceFixture.java
@@ -76,7 +76,11 @@
@Override
public void updateCall(ParcelableCall call) throws RemoteException {
if (!mCallById.containsKey(call.getId())) {
- throw new RuntimeException("Call " + call.getId() + " not added yet");
+ // This used to throw an exception, however the actual InCallService implementation
+ // ignores updates for calls which don't yet exist. This is not a problem as when
+ // a call is added to an InCallService its entire state is parceled and sent to the
+ // InCallService.
+ return;
}
mLatestCallId = call.getId();
mCallById.put(call.getId(), call);