Search in sources :

Example 1 with CallQuality

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

the class InProgressCallSessionTest method testAddCallQualityEvent.

@Test
@SmallTest
public void testAddCallQualityEvent() {
    CallQuality cq = new CallQuality();
    cq.downlinkLevel = CallQuality.CallQualityLevel.GOOD;
    cq.uplinkLevel = CallQuality.CallQualityLevel.GOOD;
    CallSessionEventBuilder builder = new CallSessionEventBuilder(TelephonyProto.TelephonyCallSession.Event.Type.CALL_QUALITY_CHANGED).setCallQuality(cq);
    mCallSession.addEvent(builder);
    assertEquals(builder.build(), mCallSession.events.getFirst());
}
Also used : CallQuality(com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.CallQuality) SmallTest(android.test.suitebuilder.annotation.SmallTest) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 2 with CallQuality

use of com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.CallQuality 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)2 TelephonyTest (com.android.internal.telephony.TelephonyTest)2 CallQuality (com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.CallQuality)2 Test (org.junit.Test)2 CallQualitySummary (com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.CallQualitySummary)1 SignalStrength (com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.SignalStrength)1