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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations