Search in sources :

Example 16 with DataCallResponse

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));
}
Also used : DataCallResponse(android.telephony.data.DataCallResponse) LinkAddress(android.net.LinkAddress) ArrayList(java.util.ArrayList) AsyncResult(android.os.AsyncResult) SmallTest(android.test.suitebuilder.annotation.SmallTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Aggregations

DataCallResponse (android.telephony.data.DataCallResponse)16 LinkAddress (android.net.LinkAddress)10 SmallTest (android.test.suitebuilder.annotation.SmallTest)10 Test (org.junit.Test)9 TelephonyTest (com.android.internal.telephony.TelephonyTest)8 MediumTest (android.test.suitebuilder.annotation.MediumTest)6 LinkProperties (android.net.LinkProperties)4 AsyncResult (android.os.AsyncResult)2 SetupDataCallResult (android.hardware.radio.V1_0.SetupDataCallResult)1 Message (android.os.Message)1 Parcel (android.os.Parcel)1 DataFailureCause (android.telephony.Annotation.DataFailureCause)1 DataProfile (android.telephony.data.DataProfile)1 FlakyTest (androidx.test.filters.FlakyTest)1 CommandException (com.android.internal.telephony.CommandException)1 SmsResponse (com.android.internal.telephony.SmsResponse)1 TelephonyEvent (com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent)1 RilSetupDataCallResponse (com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent.RilSetupDataCallResponse)1 TelephonyLog (com.android.internal.telephony.nano.TelephonyProto.TelephonyLog)1 ArrayList (java.util.ArrayList)1