Simplify deallocation/unbinding of services.
Call counts of call services and selectors are kept current during call
and during the outgoing call process. This allows us to unbind simply
when the call-count goes down to 0.
A second optimization that can be made is to remove associated-call
counts from ServiceBinder and use the callIdMapper to maintain counts of
the associated calls. This binds the call count to the mapper items,
however there are two small roadblocks:
1. It isn't as easy to deal with the replace() scenario, but doable
2. The caller-ID mapper implementations between CS and selectors are
separate and it's nice to keep a single associated count implementation
for all ServiceBinders...this is also addressable, just not that
important at the moment.
Change-Id: Ibbf894ed5b7dd9ede1b088e530dd9cc2e0e649c2
diff --git a/src/com/android/telecomm/OutgoingCallsManager.java b/src/com/android/telecomm/OutgoingCallsManager.java
index def5211..7bbfd04 100644
--- a/src/com/android/telecomm/OutgoingCallsManager.java
+++ b/src/com/android/telecomm/OutgoingCallsManager.java
@@ -162,12 +162,17 @@
* Aborts any ongoing attempts to connect the specified (outgoing) call.
*
* @param call The call to be aborted.
+ * @return False if the call was not found; True otherwise, indicating that the abort was
+ * successful.
*/
- void abort(Call call) {
+ boolean abort(Call call) {
Log.v(this, "abort, call: %s", call);
OutgoingCallProcessor processor = mOutgoingCallProcessors.remove(call);
if (processor != null) {
processor.abort();
+ return true;
}
+
+ return false;
}
}