summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNazanin <nazaninb@google.com>2021-07-27 14:46:13 -0700
committerNazanin <nazaninb@google.com>2021-07-27 14:46:13 -0700
commita320fe946c6b2b48daf42fbfab23130dbdce85c9 (patch)
treea26a72237e56775500e9544db7d505fc6f1a761c /tests
parent4a0400e55303ea9796e18fe8a649289eafe43e91 (diff)
downloadplatform_packages_services_Telecomm-a320fe946c6b2b48daf42fbfab23130dbdce85c9.tar.gz
platform_packages_services_Telecomm-a320fe946c6b2b48daf42fbfab23130dbdce85c9.tar.bz2
platform_packages_services_Telecomm-a320fe946c6b2b48daf42fbfab23130dbdce85c9.zip
Make transition of DIALING->DISCONNECTED
similar logic as ACTIVE->DISCONNECTED, so that disconnect reason is updated and handled by CallDiagnosticService Bug: 194215287 Test: utest added Change-Id: Ib8502f19ef501d4a9bf71cceb4340ee656299319
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/server/telecom/tests/CallsManagerTest.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/src/com/android/server/telecom/tests/CallsManagerTest.java b/tests/src/com/android/server/telecom/tests/CallsManagerTest.java
index 00549cb79..da7293330 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 @@ public class CallsManagerTest extends TelecomTestCase {
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);