Search in sources :

Example 11 with TelephonyEvent

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

Aggregations

TelephonyEvent (com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent)11 FlakyTest (android.support.test.filters.FlakyTest)3 SmallTest (android.test.suitebuilder.annotation.SmallTest)3 TelephonyTest (com.android.internal.telephony.TelephonyTest)3 TelephonyLog (com.android.internal.telephony.nano.TelephonyProto.TelephonyLog)3 Test (org.junit.Test)3 TelephonyServiceState (com.android.internal.telephony.nano.TelephonyProto.TelephonyServiceState)2 ImsReasonInfo (com.android.ims.ImsReasonInfo)1 TelephonyProto (com.android.internal.telephony.nano.TelephonyProto)1 ImsCapabilities (com.android.internal.telephony.nano.TelephonyProto.ImsCapabilities)1 ImsConnectionState (com.android.internal.telephony.nano.TelephonyProto.ImsConnectionState)1 SmsSession (com.android.internal.telephony.nano.TelephonyProto.SmsSession)1 TelephonyCallSession (com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession)1 RilCall (com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.RilCall)1 ModemRestart (com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent.ModemRestart)1 TelephonySettings (com.android.internal.telephony.nano.TelephonyProto.TelephonySettings)1 IndentingPrintWriter (com.android.internal.util.IndentingPrintWriter)1