use of android.telephony.data.DataCallResponse in project android_frameworks_opt_telephony by LineageOS.
the class DcControllerTest method testDataDormant.
@Test
@SmallTest
public void testDataDormant() throws Exception {
assertEquals("DccDefaultState", getCurrentState().getName());
ArrayList<DataCallResponse> l = new ArrayList<>();
DataCallResponse dcResponse = new DataCallResponse.Builder().setCause(0).setSuggestedRetryTime(-1).setId(1).setLinkStatus(DATA_CONNECTION_ACTIVE_PH_LINK_DORMANT).setProtocolType(ApnSetting.PROTOCOL_IP).setInterfaceName(FAKE_IFNAME).setAddresses(Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress(FAKE_ADDRESS), 0))).setDnsAddresses(Arrays.asList(InetAddresses.parseNumericAddress(FAKE_DNS))).setGatewayAddresses(Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY))).setPcscfAddresses(Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS))).setMtuV4(1440).setMtuV6(1440).build();
l.add(dcResponse);
mDc.mCid = 1;
mDcc.addActiveDcByCid(mDc);
mDcc.sendMessage(EVENT_DATA_STATE_CHANGED, new AsyncResult(null, l, null));
processAllMessages();
verify(mDcTracker, times(1)).sendStopNetStatPoll(eq(DctConstants.Activity.DORMANT));
}
Aggregations