Search in sources :

Example 21 with TelephonyLog

use of com.android.internal.telephony.nano.TelephonyProto.TelephonyLog in project android_frameworks_opt_telephony by LineageOS.

the class TelephonyMetricsTest method testWriteOnImsCallHandoverEvent.

// Test write on ims call handover event
@Test
@SmallTest
public void testWriteOnImsCallHandoverEvent() throws Exception {
    mMetrics.writeOnImsCallStart(mPhone.getPhoneId(), mImsCallSession);
    mMetrics.writeOnImsCallHandoverEvent(mPhone.getPhoneId(), TelephonyCallSession.Event.Type.IMS_CALL_HANDOVER, mImsCallSession, 5, 6, mImsReasonInfo);
    mMetrics.writePhoneState(mPhone.getPhoneId(), PhoneConstants.State.IDLE);
    TelephonyLog log = buildProto();
    assertEquals(0, log.events.length);
    assertEquals(1, log.callSessions.length);
    assertEquals(0, log.smsSessions.length);
    assertEquals(2, log.callSessions[0].events.length);
    assertFalse(log.callSessions[0].eventsDropped);
    assertEquals(TelephonyCallSession.Event.Type.IMS_CALL_HANDOVER, log.callSessions[0].events[1].type);
    assertEquals(123, log.callSessions[0].events[1].callIndex);
    assertEquals(5, log.callSessions[0].events[1].srcAccessTech);
    assertEquals(6, log.callSessions[0].events[1].targetAccessTech);
    assertEquals("extramessage", log.callSessions[0].events[1].reasonInfo.extraMessage);
    assertEquals(456, log.callSessions[0].events[1].reasonInfo.extraCode);
    assertEquals(123, log.callSessions[0].events[1].reasonInfo.reasonCode);
}
Also used : TelephonyLog(com.android.internal.telephony.nano.TelephonyProto.TelephonyLog) SmallTest(android.test.suitebuilder.annotation.SmallTest) FlakyTest(android.support.test.filters.FlakyTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 22 with TelephonyLog

use of com.android.internal.telephony.nano.TelephonyProto.TelephonyLog in project android_frameworks_opt_telephony by LineageOS.

the class TelephonyMetricsTest method testEventDropped.

@Test
@SmallTest
public void testEventDropped() throws Exception {
    for (int i = 0; i < 1001; i++) {
        mMetrics.writeDataStallEvent(mPhone.getPhoneId(), i);
    }
    TelephonyLog log = buildProto();
    assertEquals(1000, log.events.length);
    assertEquals(0, log.callSessions.length);
    assertEquals(0, log.smsSessions.length);
    assertTrue(log.eventsDropped);
    assertEquals(1, log.events[0].dataStallAction);
}
Also used : TelephonyLog(com.android.internal.telephony.nano.TelephonyProto.TelephonyLog) SmallTest(android.test.suitebuilder.annotation.SmallTest) FlakyTest(android.support.test.filters.FlakyTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Aggregations

TelephonyLog (com.android.internal.telephony.nano.TelephonyProto.TelephonyLog)22 FlakyTest (android.support.test.filters.FlakyTest)20 SmallTest (android.test.suitebuilder.annotation.SmallTest)20 TelephonyTest (com.android.internal.telephony.TelephonyTest)20 Test (org.junit.Test)20 TelephonyEvent (com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent)7 TelephonyServiceState (com.android.internal.telephony.nano.TelephonyProto.TelephonyServiceState)2 TelephonyHistogram (android.telephony.TelephonyHistogram)1 SmsResponse (com.android.internal.telephony.SmsResponse)1 DataCallResponse (com.android.internal.telephony.dataconnection.DataCallResponse)1 TelephonyProto (com.android.internal.telephony.nano.TelephonyProto)1 RilCall (com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.RilCall)1 Method (java.lang.reflect.Method)1