aboutsummaryrefslogtreecommitdiff
path: root/tests/telephonytests
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2020-06-05 15:12:17 -0700
committerTyler Gunn <tgunn@google.com>2020-06-08 08:59:41 -0700
commite1975df2c330a7ae5b680c718a65604fae8b4628 (patch)
tree315321efa40548c9ccbc35e6bb566dae5ca97e0a /tests/telephonytests
parent2fe809be097b78344d77e93b0b6f0eee3be16d3a (diff)
downloadtelephony-e1975df2c330a7ae5b680c718a65604fae8b4628.tar.gz
Fix issue where disconnect cause notification does not fire.
TelephonyRegistry was not firing the notifyDisconnectCause and hence LISTEN_PRECISE_DATA_CONNECTION_STATE listeners were not getting notified of the disconnect cause. The root cause turns out to be that sub id and phone id were swapped in the parameter list. That'll do it. Test: Manual testing to verify registry is updated now. Test: Update now-failing unit test and modify parameters to make it more clear which is the phone id and which is the sub id. The old test was passing and it was clearly wrong. Fixes: 157729584 Change-Id: I04a837cbf7447074467ef91804c07c96d5c461dc
Diffstat (limited to 'tests/telephonytests')
-rw-r--r--tests/telephonytests/src/com/android/internal/telephony/DefaultPhoneNotifierTest.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/telephonytests/src/com/android/internal/telephony/DefaultPhoneNotifierTest.java b/tests/telephonytests/src/com/android/internal/telephony/DefaultPhoneNotifierTest.java
index 04d7d06087..81c2f5607d 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/DefaultPhoneNotifierTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/DefaultPhoneNotifierTest.java
@@ -46,6 +46,8 @@ import java.util.Collections;
import java.util.List;
public class DefaultPhoneNotifierTest extends TelephonyTest {
+ private static final int PHONE_ID = 1;
+ private static final int SUB_ID = 0;
private DefaultPhoneNotifier mDefaultPhoneNotifierUT;
@Mock
@@ -152,17 +154,17 @@ public class DefaultPhoneNotifierTest extends TelephonyTest {
@Test @SmallTest
public void testNotifyDisconnectCause() throws Exception {
- doReturn(1).when(mPhone).getPhoneId();
- doReturn(0).when(mPhone).getSubId();
+ doReturn(PHONE_ID).when(mPhone).getPhoneId();
+ doReturn(SUB_ID).when(mPhone).getSubId();
mDefaultPhoneNotifierUT.notifyDisconnectCause(mPhone, DisconnectCause.NOT_VALID,
PreciseDisconnectCause.FDN_BLOCKED);
- verify(mTelephonyRegistryManager).notifyDisconnectCause(0, 1, DisconnectCause.NOT_VALID,
- PreciseDisconnectCause.FDN_BLOCKED);
+ verify(mTelephonyRegistryManager).notifyDisconnectCause(PHONE_ID, SUB_ID,
+ DisconnectCause.NOT_VALID, PreciseDisconnectCause.FDN_BLOCKED);
mDefaultPhoneNotifierUT.notifyDisconnectCause(mPhone, DisconnectCause.LOCAL,
PreciseDisconnectCause.CHANNEL_NOT_AVAIL);
- verify(mTelephonyRegistryManager).notifyDisconnectCause(0, 1, DisconnectCause.LOCAL,
- PreciseDisconnectCause.CHANNEL_NOT_AVAIL);
+ verify(mTelephonyRegistryManager).notifyDisconnectCause(PHONE_ID, SUB_ID,
+ DisconnectCause.LOCAL, PreciseDisconnectCause.CHANNEL_NOT_AVAIL);
}
@Test @SmallTest