Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73e9d62d authored by Tyler Gunn's avatar Tyler Gunn Committed by Android (Google) Code Review
Browse files

Merge "Fix issue where disconnect cause notification does not fire." into rvc-dev

parents 1fdfa936 e1975df2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
    }

    public void notifyDisconnectCause(Phone sender, int cause, int preciseCause) {
        mTelephonyRegistryMgr.notifyDisconnectCause(sender.getSubId(), sender.getPhoneId(), cause,
        mTelephonyRegistryMgr.notifyDisconnectCause(sender.getPhoneId(), sender.getSubId(), cause,
                preciseCause);
    }

+8 −6
Original line number Diff line number Diff line
@@ -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