Fix crash when making an outgoing call
Fix the Log.wtf exception that occurs because mPendingOutgoingCallIds
does not contain the expected callId
Change-Id: I5cf6b08a2bffd883b89791d3cca9d5fc6b2175f6
diff --git a/src/com/android/telecomm/Call.java b/src/com/android/telecomm/Call.java
index 6660dc3..0b60c4a 100644
--- a/src/com/android/telecomm/Call.java
+++ b/src/com/android/telecomm/Call.java
@@ -155,10 +155,7 @@
void setCallService(CallServiceWrapper callService) {
Preconditions.checkNotNull(callService);
- if (mCallService != null) {
- // Should never be the case, basically covering for potential programming errors.
- decrementAssociatedCallCount(mCallService);
- }
+ clearCallService();
callService.incrementAssociatedCallCount();
mCallService = callService;
@@ -168,8 +165,11 @@
* Clears the associated call service.
*/
void clearCallService() {
- decrementAssociatedCallCount(mCallService);
- mCallService = null;
+ if (mCallService != null) {
+ decrementAssociatedCallCount(mCallService);
+ mCallService.cancelOutgoingCall(getId());
+ mCallService = null;
+ }
}
void setCallServiceSelector(ICallServiceSelector selector) {