Work in preparation for wiring up the remaining de-allocation and
abort bits.
1) limit to one attempt per call service upon multiple selectors
returning the same call service
2) record the failing/incompatible ones such that these are avoided
when switching
3) addressing some related todos etc.
Change-Id: I62204e9947bb8557888df33ca70f4352d3e6decf
diff --git a/src/com/android/telecomm/CallServiceAdapter.java b/src/com/android/telecomm/CallServiceAdapter.java
index 3e63f39..1e830d5 100644
--- a/src/com/android/telecomm/CallServiceAdapter.java
+++ b/src/com/android/telecomm/CallServiceAdapter.java
@@ -74,8 +74,17 @@
}
/** {@inheritDoc} */
- @Override public void setIsCompatibleWith(String callId, boolean isCompatible) {
- // TODO(santoscordon): fill in.
+ @Override public void setIsCompatibleWith(final String callId, final boolean isCompatible) {
+ checkValidCallId(callId);
+ mHandler.post(new Runnable() {
+ @Override public void run() {
+ if (mPendingOutgoingCallIds.contains(callId)) {
+ mOutgoingCallsManager.setIsCompatibleWith(callId, isCompatible);
+ } else {
+ Log.wtf(CallServiceAdapter.this, "Unknown outgoing call: %s", callId);
+ }
+ }
+ });
}
/** {@inheritDoc} */
@@ -86,8 +95,7 @@
if (mPendingIncomingCallIds.remove(callInfo.getId())) {
mIncomingCallsManager.handleSuccessfulIncomingCall(callInfo);
} else {
- Log.wtf(CallServiceAdapter.this,
- "Unknown incoming call: %s", callInfo);
+ Log.wtf(CallServiceAdapter.this, "Unknown incoming call: %s", callInfo);
}
}
});
@@ -102,8 +110,7 @@
mOutgoingCallsManager.handleSuccessfulCallAttempt(callId);
} else {
// TODO(gilad): Figure out how to wire up the callService.abort() call.
- Log.wtf(CallServiceAdapter.this,
- "Unknown outgoing call: %s", callId);
+ Log.wtf(CallServiceAdapter.this, "Unknown outgoing call: %s", callId);
}
}
});
@@ -117,8 +124,7 @@
if (mPendingOutgoingCallIds.remove(callId)) {
mOutgoingCallsManager.handleFailedCallAttempt(callId, reason);
} else {
- Log.wtf(CallServiceAdapter.this,
- "Unknown outgoing call: %s", callId);
+ Log.wtf(CallServiceAdapter.this, "Unknown outgoing call: %s", callId);
}
}
});