Merge "Allow missed reason of test incoming call to be USER_MISSED_CALL_FILTERS_TIMEOUT." into sc-dev
diff --git a/res/values/strings.xml b/res/values/strings.xml
index df08d7c..01bb88c 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -17,8 +17,10 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Official label of the Telecomm/Phone app, as seen in "Manage Applications"
and other settings UIs. This is the "app name" used in notification, recents,
- and app info screens. -->
- <string name="telecommAppLabel" product="default">Call Management</string>
+ and app info screens. The term "phone calls" is used since an end user would more commonly
+ think of the stuff the Telecom framework deals with as having to do with "phone calls",
+ not "call management" (even though that is technically more accurate). -->
+ <string name="telecommAppLabel" product="default">Phone Calls</string>
<!-- Title used for the activity for placing a call. This name appears
in activity disambig dialogs -->
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 687a882..ea45abb 100755
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -3131,7 +3131,8 @@
// If a call diagnostic service is in use, we will log the original telephony-provided
// disconnect cause, inform the CDS of the disconnection, and then chain the update of the
// call state until AFTER the CDS reports it's result back.
- if (oldState == CallState.ACTIVE && disconnectCause.getCode() != DisconnectCause.MISSED
+ if ((oldState == CallState.ACTIVE || oldState == CallState.DIALING)
+ && disconnectCause.getCode() != DisconnectCause.MISSED
&& mCallDiagnosticServiceController.isConnected()
&& mCallDiagnosticServiceController.onCallDisconnected(call, disconnectCause)) {
Log.i(this, "markCallAsDisconnected; callid=%s, postingToFuture.", call.getId());
diff --git a/tests/src/com/android/server/telecom/tests/CallsManagerTest.java b/tests/src/com/android/server/telecom/tests/CallsManagerTest.java
index 00549cb..da72933 100644
--- a/tests/src/com/android/server/telecom/tests/CallsManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallsManagerTest.java
@@ -1604,6 +1604,26 @@
any(DisconnectCause.class));
verify(callSpy, never()).setDisconnectCause(any(DisconnectCause.class));
}
+
+ /**
+ * Verifies that if call state goes from DIALING to DISCONNECTED, and a call diagnostic service
+ * IS in use, it would call onCallDisconnected of the CallDiagnosticService
+ * @throws Exception
+ */
+ @MediumTest
+ @Test
+ public void testDisconnectDialingCall() throws Exception {
+ Call callSpy = addSpyCall(CallState.DIALING);
+ callSpy.setIsSimCall(true);
+ when(mCallDiagnosticServiceController.isConnected()).thenReturn(true);
+ when(mCallDiagnosticServiceController.onCallDisconnected(any(Call.class),
+ any(DisconnectCause.class))).thenReturn(true);
+ mCallsManager.markCallAsDisconnected(callSpy, new DisconnectCause(DisconnectCause.ERROR));
+
+ verify(mCallDiagnosticServiceController).onCallDisconnected(any(Call.class),
+ any(DisconnectCause.class));
+ verify(callSpy, never()).setDisconnectCause(any(DisconnectCause.class));
+ }
private Call addSpyCall() {
return addSpyCall(SIM_2_HANDLE, CallState.ACTIVE);