use of com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent in project android_frameworks_opt_telephony by LineageOS.
the class TelephonyMetricsTest method testWriteOnImsCapabilities.
// Test write ims capabilities changed
@Test
@SmallTest
public void testWriteOnImsCapabilities() throws Exception {
boolean[] caps1 = new boolean[] { true, false, true, false, true, false };
mMetrics.writeOnImsCapabilities(mPhone.getPhoneId(), caps1);
boolean[] caps2 = new boolean[] { true, false, true, false, true, false };
// The duplicate one should be filtered out.
mMetrics.writeOnImsCapabilities(mPhone.getPhoneId(), caps2);
boolean[] caps3 = new boolean[] { false, true, false, true, false, true };
mMetrics.writeOnImsCapabilities(mPhone.getPhoneId(), caps3);
TelephonyLog log = buildProto();
assertEquals(2, log.events.length);
assertEquals(0, log.callSessions.length);
assertEquals(0, log.smsSessions.length);
TelephonyEvent event = log.events[0];
assertEquals(TelephonyEvent.Type.IMS_CAPABILITIES_CHANGED, event.type);
assertEquals(caps1[0], event.imsCapabilities.voiceOverLte);
assertEquals(caps1[1], event.imsCapabilities.videoOverLte);
assertEquals(caps1[2], event.imsCapabilities.voiceOverWifi);
assertEquals(caps1[3], event.imsCapabilities.videoOverWifi);
assertEquals(caps1[4], event.imsCapabilities.utOverLte);
assertEquals(caps1[5], event.imsCapabilities.utOverWifi);
event = log.events[1];
assertEquals(TelephonyEvent.Type.IMS_CAPABILITIES_CHANGED, event.type);
assertEquals(caps3[0], event.imsCapabilities.voiceOverLte);
assertEquals(caps3[1], event.imsCapabilities.videoOverLte);
assertEquals(caps3[2], event.imsCapabilities.voiceOverWifi);
assertEquals(caps3[3], event.imsCapabilities.videoOverWifi);
assertEquals(caps3[4], event.imsCapabilities.utOverLte);
assertEquals(caps3[5], event.imsCapabilities.utOverWifi);
}
Aggregations