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