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

Commit 9b73d2d4 authored by Tyler Gunn's avatar Tyler Gunn Committed by Automerger Merge Worker
Browse files

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/11762949

Change-Id: I57d23901a5d19ac554c00ccc11bdcac0dd59008f
parents 029b7d99 73e9d62d
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