Search in sources :

Example 6 with TelephonyLog

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

the class TelephonyMetricsTest method testProtoEncodingDecoding.

// Test Proto Encoding/Decoding
@Test
@SmallTest
public void testProtoEncodingDecoding() throws Exception {
    mMetrics.writeServiceStateChanged(mPhone.getPhoneId(), mServiceState);
    TelephonyLog log = buildProto();
    String encodedString = convertProtoToBase64String(log);
    byte[] decodedString = Base64.decode(encodedString, Base64.DEFAULT);
    assertArrayEquals(TelephonyProto.TelephonyLog.toByteArray(log), decodedString);
}
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 7 with TelephonyLog

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

the class TelephonyMetricsTest method testWriteOnDeactivateDataCallResponse.

// Test write on deactivate data call response
@Test
@SmallTest
public void testWriteOnDeactivateDataCallResponse() throws Exception {
    mMetrics.writeOnRilSolicitedResponse(mPhone.getPhoneId(), 2, 3, RIL_REQUEST_DEACTIVATE_DATA_CALL, null);
    TelephonyLog log = buildProto();
    assertEquals(1, log.events.length);
    assertEquals(0, log.callSessions.length);
    assertEquals(0, log.smsSessions.length);
    assertFalse(log.eventsDropped);
    assertEquals(TelephonyEvent.Type.DATA_CALL_DEACTIVATE_RESPONSE, log.events[0].type);
    assertEquals(4, log.events[0].error);
}
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 8 with TelephonyLog

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

the class TelephonyMetricsTest method testWriteOnImsCallReceive.

// Test write on IMS call received
@Test
@SmallTest
public void testWriteOnImsCallReceive() throws Exception {
    mMetrics.writeOnImsCallReceive(mPhone.getPhoneId(), mImsCallSession);
    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(mPhone.getPhoneId(), log.callSessions[0].phoneId);
    assertFalse(log.callSessions[0].eventsDropped);
    assertEquals(1, log.callSessions[0].events.length);
    assertEquals(123, log.callSessions[0].events[0].callIndex);
}
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 9 with TelephonyLog

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

the class TelephonyMetricsTest method testWriteRilSetupDataCall.

// Test write RIL setup data call
@Test
@SmallTest
public void testWriteRilSetupDataCall() throws Exception {
    mMetrics.writeRilSetupDataCall(mPhone.getPhoneId(), 1, 14, 3, "apn", 0, "IPV4V6");
    TelephonyLog log = buildProto();
    assertEquals(1, log.events.length);
    assertEquals(0, log.callSessions.length);
    assertEquals(0, log.smsSessions.length);
    assertFalse(log.eventsDropped);
    assertEquals(TelephonyEvent.Type.DATA_CALL_SETUP, log.events[0].type);
    TelephonyEvent.RilSetupDataCall setupDataCall = log.events[0].setupDataCall;
    assertEquals("apn", setupDataCall.apn);
    assertEquals(14, setupDataCall.rat);
    assertEquals(4, setupDataCall.dataProfile);
    assertEquals(PDP_TYPE_IPV4V6, setupDataCall.type);
}
Also used : TelephonyLog(com.android.internal.telephony.nano.TelephonyProto.TelephonyLog) TelephonyEvent(com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent) 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 10 with TelephonyLog

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

the class TelephonyMetricsTest method testWriteOnImsCallStart.

// Test write on IMS call start
@Test
@SmallTest
public void testWriteOnImsCallStart() throws Exception {
    mMetrics.writeOnImsCallStart(mPhone.getPhoneId(), mImsCallSession);
    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(mPhone.getPhoneId(), log.callSessions[0].phoneId);
    assertFalse(log.callSessions[0].eventsDropped);
    assertEquals(1, log.callSessions[0].events.length);
    assertEquals(123, log.callSessions[0].events[0].callIndex);
    assertEquals(ImsCommand.IMS_CMD_START, log.callSessions[0].events[0].imsCommand);
}
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