Search in sources :

Example 1 with SignalStrength

use of com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.SignalStrength in project android_frameworks_opt_telephony by LineageOS.

the class InProgressCallSessionTest method testAddCallQualitySummaryEvent.

@Test
@SmallTest
public void testAddCallQualitySummaryEvent() {
    SignalStrength ss1 = new SignalStrength();
    ss1.lteSnr = 22;
    SignalStrength ss2 = new SignalStrength();
    ss2.lteSnr = 44;
    CallQuality cq1 = new CallQuality();
    cq1.downlinkLevel = CallQuality.CallQualityLevel.GOOD;
    cq1.uplinkLevel = CallQuality.CallQualityLevel.GOOD;
    CallQuality cq2 = new CallQuality();
    cq1.downlinkLevel = CallQuality.CallQualityLevel.BAD;
    cq1.uplinkLevel = CallQuality.CallQualityLevel.BAD;
    CallQualitySummary cqs = new CallQualitySummary();
    cqs.totalGoodQualityDurationInSeconds = 2;
    cqs.totalBadQualityDurationInSeconds = 3;
    cqs.totalDurationWithQualityInformationInSeconds = 5;
    cqs.snapshotOfWorstSsWithGoodQuality = cq2;
    cqs.snapshotOfBestSsWithGoodQuality = cq2;
    cqs.snapshotOfWorstSsWithBadQuality = cq1;
    cqs.snapshotOfBestSsWithBadQuality = cq1;
    cqs.worstSsWithGoodQuality = ss1;
    cqs.bestSsWithGoodQuality = ss2;
    cqs.worstSsWithBadQuality = ss1;
    cqs.bestSsWithBadQuality = ss2;
    CallSessionEventBuilder builder = new CallSessionEventBuilder(TelephonyProto.TelephonyCallSession.Event.Type.CALL_QUALITY_CHANGED).setCallQualitySummaryDl(cqs).setCallQualitySummaryUl(cqs);
    mCallSession.addEvent(builder);
    assertEquals(builder.build(), mCallSession.events.getFirst());
}
Also used : CallQuality(com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.CallQuality) CallQualitySummary(com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.CallQualitySummary) SignalStrength(com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.SignalStrength) SmallTest(android.test.suitebuilder.annotation.SmallTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Aggregations

SmallTest (android.test.suitebuilder.annotation.SmallTest)1 TelephonyTest (com.android.internal.telephony.TelephonyTest)1 CallQuality (com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.CallQuality)1 CallQualitySummary (com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.CallQualitySummary)1 SignalStrength (com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.SignalStrength)1 Test (org.junit.Test)1