Clear postdial digits on failed outgoing call.
The Postdial digits are populated when a call is created in Telecom; the
connectionservice strips the postdial digits and edits the outgoing
connection back to Telecom once its created, removing them from the
Telecom call. When a call fails fast in Telephony, a failed connection
is sent to Telecom without the stripped postdial digits; further even if
it were sent the failed connection is simply used as a placeholder to stop
the connection creation process.
To solve this issue, clearing the postdial digits on the telecom call when
a connection creation failure occurs. The result is the call log entry
will not have postdial digits separated from the dial digits. However
given this is such an edgecase this workaround is reasonable.
Test: Remove sim and verify this is not an issue.
Bug: 123622080
Change-Id: I78970c747cf83aba8bd9211d7b326ed84433479b
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java
index 628df84..84ceee6 100644
--- a/src/com/android/server/telecom/Call.java
+++ b/src/com/android/server/telecom/Call.java
@@ -254,7 +254,7 @@
/**
* The post-dial digits that were dialed after the network portion of the number
*/
- private final String mPostDialDigits;
+ private String mPostDialDigits;
/**
* The secondary line number that an incoming call has been received on if the SIM subscription
@@ -1005,6 +1005,10 @@
return mPostDialDigits;
}
+ public void clearPostDialDigits() {
+ mPostDialDigits = null;
+ }
+
public String getViaNumber() {
return mViaNumber;
}
diff --git a/src/com/android/server/telecom/ConnectionServiceWrapper.java b/src/com/android/server/telecom/ConnectionServiceWrapper.java
index 90064cd..eb2e233 100644
--- a/src/com/android/server/telecom/ConnectionServiceWrapper.java
+++ b/src/com/android/server/telecom/ConnectionServiceWrapper.java
@@ -1662,6 +1662,14 @@
if (connection.getState() == Connection.STATE_DISCONNECTED) {
// A connection that begins in the DISCONNECTED state is an indication of
// failure to connect; we handle all failures uniformly
+ Call foundCall = mCallIdMapper.getCall(callId);
+ if (foundCall != null) {
+ // The post-dial digits are created when the call is first created. Normally
+ // the ConnectionService is responsible for stripping them from the address, but
+ // since a failed connection will not have done this, we could end up with duplicate
+ // post-dial digits.
+ foundCall.clearPostDialDigits();
+ }
removeCall(callId, connection.getDisconnectCause());
} else {
// Successful connection