Fix making outgoing calls
This CL fixes the following issues with outgoing calls:
- Switchboard.placeOutgoingCall doesn't keep track of calls
- ServiceBinder.bind calls setServiceInterface() multiple times if service is already bound
- OutgoingCallProcessor.mCallServicesByInfo uses a custom object as a key which makes it impossible to look up call services
- OutgoingCallProcessor.attemptNextCallService invokes CallServiceWrapper.call without binding first
Change-Id: Ia7983f52c8c03ed9aa44e2c52c20ce9c1c9c75de
diff --git a/src/com/android/telecomm/ServiceBinder.java b/src/com/android/telecomm/ServiceBinder.java
index c58791c..101b940 100644
--- a/src/com/android/telecomm/ServiceBinder.java
+++ b/src/com/android/telecomm/ServiceBinder.java
@@ -59,7 +59,8 @@
mServiceConnection = this;
mBinder = binder;
- handleSuccessfulConnection(binder);
+ setServiceInterface(binder);
+ handleSuccessfulConnection();
}
@Override
@@ -140,7 +141,7 @@
}
} else {
Preconditions.checkNotNull(mBinder);
- handleSuccessfulConnection(mBinder);
+ handleSuccessfulConnection();
}
return true;
@@ -169,12 +170,8 @@
/**
* Notifies all the outstanding callbacks that the service is successfully bound. The list of
* outstanding callbacks is cleared afterwards.
- *
- * @param binder The actual bound service implementation.
*/
- private void handleSuccessfulConnection(IBinder binder) {
- setServiceInterface(binder);
-
+ private void handleSuccessfulConnection() {
for (BindCallback callback : mCallbacks) {
callback.onSuccess();
}