Search in sources :

Example 11 with FlakyTest

use of androidx.test.filters.FlakyTest in project android_frameworks_opt_telephony by LineageOS.

the class ServiceStateTrackerTest method testCdmaCellLocation.

@FlakyTest
/* flakes 0.86% of the time */
@Test
@MediumTest
public // TODO(nharold): we probably should remove support for this procedure (GET_LOC)
void testCdmaCellLocation() {
    CellIdentityCdma cellIdentityCdma = new CellIdentityCdma(1, 2, 3, 4, 5, "test", "tst");
    NetworkRegistrationInfo result = new NetworkRegistrationInfo.Builder().setDomain(NetworkRegistrationInfo.DOMAIN_CS).setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN).setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME).setCellIdentity(cellIdentityCdma).build();
    sst.sendMessage(sst.obtainMessage(ServiceStateTracker.EVENT_GET_LOC_DONE, new AsyncResult(null, result, null)));
    waitForLastHandlerAction(mSSTTestHandler.getThreadHandler());
    WorkSource workSource = new WorkSource(Process.myUid(), mContext.getPackageName());
    CdmaCellLocation cl = (CdmaCellLocation) sst.getCellIdentity().asCellLocation();
    assertEquals(5, cl.getBaseStationLatitude());
    assertEquals(4, cl.getBaseStationLongitude());
}
Also used : CellIdentityCdma(android.telephony.CellIdentityCdma) NetworkRegistrationInfo(android.telephony.NetworkRegistrationInfo) CdmaCellLocation(android.telephony.cdma.CdmaCellLocation) WorkSource(android.os.WorkSource) AsyncResult(android.os.AsyncResult) FlakyTest(androidx.test.filters.FlakyTest) FlakyTest(androidx.test.filters.FlakyTest) MediumTest(android.test.suitebuilder.annotation.MediumTest) SmallTest(android.test.suitebuilder.annotation.SmallTest) Test(org.junit.Test) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 12 with FlakyTest

use of androidx.test.filters.FlakyTest in project android_frameworks_opt_telephony by LineageOS.

the class RILTest method testSendRetryImsGsmSms.

@FlakyTest
@Test
public void testSendRetryImsGsmSms() throws Exception {
    String smscPdu = "smscPdu";
    String pdu = "pdu";
    GsmSmsMessage gsmMsg = new GsmSmsMessage();
    gsmMsg.smscPdu = smscPdu;
    gsmMsg.pdu = pdu;
    ImsSmsMessage firstMsg = new ImsSmsMessage();
    firstMsg.tech = RILConstants.GSM_PHONE;
    firstMsg.retry = false;
    firstMsg.messageRef = 0;
    firstMsg.gsmMessage.add(gsmMsg);
    ImsSmsMessage retryMsg = new ImsSmsMessage();
    retryMsg.tech = RILConstants.GSM_PHONE;
    retryMsg.retry = true;
    retryMsg.messageRef = 0;
    retryMsg.gsmMessage.add(gsmMsg);
    int maxRetryCount = 3;
    int firstTransmission = 0;
    for (int i = 0; i <= maxRetryCount; i++) {
        mRILUnderTest.sendImsGsmSms(smscPdu, pdu, i, 0, obtainMessage());
        if (i == firstTransmission) {
            verify(mRadioProxy, times(1)).sendImsSms(mSerialNumberCaptor.capture(), eq(firstMsg));
            verifyRILResponse(mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_IMS_SEND_SMS);
        } else {
            verify(mRadioProxy, times(i)).sendImsSms(mSerialNumberCaptor.capture(), eq(retryMsg));
            verifyRILResponse(mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_IMS_SEND_SMS);
        }
    }
}
Also used : ImsSmsMessage(android.hardware.radio.V1_0.ImsSmsMessage) GsmSmsMessage(android.hardware.radio.V1_0.GsmSmsMessage) FlakyTest(androidx.test.filters.FlakyTest) FlakyTest(androidx.test.filters.FlakyTest) Test(org.junit.Test)

Example 13 with FlakyTest

use of androidx.test.filters.FlakyTest in project android_frameworks_opt_telephony by LineageOS.

the class RILTest method testSendSMSExpectMore.

@FlakyTest
@Test
public void testSendSMSExpectMore() throws Exception {
    String smscPdu = "smscPdu";
    String pdu = "pdu";
    GsmSmsMessage msg = new GsmSmsMessage();
    msg.smscPdu = smscPdu;
    msg.pdu = pdu;
    mRILUnderTest.sendSMSExpectMore(smscPdu, pdu, obtainMessage());
    verify(mRadioProxy).sendSMSExpectMore(mSerialNumberCaptor.capture(), eq(msg));
    verifyRILResponse(mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_SEND_SMS_EXPECT_MORE);
}
Also used : GsmSmsMessage(android.hardware.radio.V1_0.GsmSmsMessage) FlakyTest(androidx.test.filters.FlakyTest) FlakyTest(androidx.test.filters.FlakyTest) Test(org.junit.Test)

Example 14 with FlakyTest

use of androidx.test.filters.FlakyTest in project android_frameworks_opt_telephony by LineageOS.

the class CdmaSmsCbTest method testCmasUnsupportedCharSet.

// VZW requirement is to discard message with unsupported charset. Verify that we return null
// for this unsupported character set.
@FlakyTest
@Ignore
@Test
@SmallTest
public void testCmasUnsupportedCharSet() throws Exception {
    SmsMessage msg = createCmasSmsMessage(SmsEnvelope.SERVICE_CATEGORY_CMAS_EXTREME_THREAT, 12345, BearerData.PRIORITY_EMERGENCY, BearerData.LANGUAGE_ENGLISH, 0x1F, EXTREME_ALERT, -1, -1, -1, -1, -1);
    SmsCbMessage cbMessage = msg.parseBroadcastSms("", 0, 1);
    assertNull("expected null for unsupported charset", cbMessage);
}
Also used : CdmaSmsMessage(android.hardware.radio.V1_0.CdmaSmsMessage) SmsCbMessage(android.telephony.SmsCbMessage) FlakyTest(androidx.test.filters.FlakyTest) Ignore(org.junit.Ignore) FlakyTest(androidx.test.filters.FlakyTest) SmallTest(android.test.suitebuilder.annotation.SmallTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 15 with FlakyTest

use of androidx.test.filters.FlakyTest in project android_frameworks_opt_telephony by LineageOS.

the class ImsPhoneTest method testCallForwardingOption.

@FlakyTest
@Test
@Ignore
public void testCallForwardingOption() throws Exception {
    Message msg = mTestHandler.obtainMessage();
    mImsPhoneUT.getCallForwardingOption(CF_REASON_UNCONDITIONAL, msg);
    ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class);
    verify(mImsUtInterface).queryCallForward(eq(ImsUtInterface.CDIV_CF_UNCONDITIONAL), (String) eq(null), messageArgumentCaptor.capture());
    assertEquals(msg, messageArgumentCaptor.getValue().obj);
    mImsPhoneUT.setCallForwardingOption(CF_ACTION_ENABLE, CF_REASON_UNCONDITIONAL, "1234", 0, msg);
    verify(mImsUtInterface).updateCallForward(eq(ImsUtInterface.ACTION_ACTIVATION), eq(ImsUtInterface.CDIV_CF_UNCONDITIONAL), eq("1234"), eq(CommandsInterface.SERVICE_CLASS_VOICE), eq(0), eq(msg));
}
Also used : Message(android.os.Message) FlakyTest(androidx.test.filters.FlakyTest) Ignore(org.junit.Ignore) FlakyTest(androidx.test.filters.FlakyTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) SmallTest(android.test.suitebuilder.annotation.SmallTest) Test(org.junit.Test)

Aggregations

FlakyTest (androidx.test.filters.FlakyTest)32 Test (org.junit.Test)32 SmallTest (android.test.suitebuilder.annotation.SmallTest)13 TelephonyTest (com.android.internal.telephony.TelephonyTest)13 Ignore (org.junit.Ignore)11 MediumTest (android.test.suitebuilder.annotation.MediumTest)10 Message (android.os.Message)9 WorkSource (android.os.WorkSource)9 AsyncResult (android.os.AsyncResult)6 Intent (android.content.Intent)5 DataProfile (android.telephony.data.DataProfile)5 Context (android.content.Context)4 GsmSmsMessage (android.hardware.radio.V1_0.GsmSmsMessage)4 CdmaSmsMessage (android.hardware.radio.V1_0.CdmaSmsMessage)3 ImsSmsMessage (android.hardware.radio.V1_0.ImsSmsMessage)3 ContentResolver (android.content.ContentResolver)2 DataProfileInfo (android.hardware.radio.V1_0.DataProfileInfo)2 NvWriteItem (android.hardware.radio.V1_0.NvWriteItem)2 SmsWriteArgs (android.hardware.radio.V1_0.SmsWriteArgs)2 CellIdentityCdma (android.telephony.CellIdentityCdma)2