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

Commit d8af5888 authored by Hunsuk Choi's avatar Hunsuk Choi Committed by Android (Google) Code Review
Browse files

Merge "Unregister the callback handler on cancelSelection"

parents 031ac63a 4cbf7184
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -176,6 +176,15 @@ public class EmergencyCallDomainSelectionConnection extends DomainSelectionConne
        }
    }

    /** {@inheritDoc} */
    @Override
    public void cancelSelection() {
        logi("cancelSelection");
        AccessNetworksManager anm = mPhone.getAccessNetworksManager();
        anm.unregisterForQualifiedNetworksChanged(mHandler);
        super.cancelSelection();
    }

    /**
     * Returns the attributes required to determine the domain for a telephony service.
     *
+7 −0
Original line number Diff line number Diff line
@@ -217,4 +217,11 @@ public class EmergencyCallDomainSelectionConnectionTest extends TelephonyTest {

        verify(mConnectionCallback).onSelectionTerminated(eq(ERROR_UNSPECIFIED));
    }

    @Test
    @SmallTest
    public void testCancelSelection() throws Exception {
        mEcDsc.cancelSelection();
        verify(mAnm).unregisterForQualifiedNetworksChanged(any());
    }
}