Search in sources :

Example 6 with CallQualitySummary

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

the class CallQualityMetricsTest method testTotalDurations_ReportedOutOfOrder.

/**
 * Verify that good/bad quality and total duration stats are correct.
 *
 * Similar to testTotalDurations but we report the call quality out of order.
 */
@Test
public void testTotalDurations_ReportedOutOfOrder() {
    // Call quality in the following sequence:
    // 
    // DL: GOOD       GOOD      BAD
    // UL: GOOD       BAD       GOOD
    // |----------|----------|--------|
    // 0          5          10       14
    // 
    // 0s = Start of call. Assumed to be good quality
    // 5s = Switches to UL bad quality
    // 10s = Switches to UL good quality, DL bad quality
    // 14s = End of call. Switches to UL bad quality, DL good quality
    CallQuality cq1 = constructCallQuality(CallQuality.CALL_QUALITY_EXCELLENT, CallQuality.CALL_QUALITY_BAD, 5000);
    CallQuality cq2 = constructCallQuality(CallQuality.CALL_QUALITY_BAD, CallQuality.CALL_QUALITY_EXCELLENT, 10000);
    CallQuality cq3 = constructCallQuality(CallQuality.CALL_QUALITY_EXCELLENT, CallQuality.CALL_QUALITY_BAD, 14000);
    mCallQualityMetrics.saveCallQuality(cq1);
    mCallQualityMetrics.saveCallQuality(cq3);
    mCallQualityMetrics.saveCallQuality(cq2);
    // verify UL quality durations
    CallQualitySummary dlSummary = mCallQualityMetrics.getCallQualitySummaryDl();
    assertEquals(9, dlSummary.totalGoodQualityDurationInSeconds);
    assertEquals(5, dlSummary.totalBadQualityDurationInSeconds);
    assertEquals(14, dlSummary.totalDurationWithQualityInformationInSeconds);
    // verify DL quality durations
    CallQualitySummary ulSummary = mCallQualityMetrics.getCallQualitySummaryUl();
    assertEquals(5, ulSummary.totalGoodQualityDurationInSeconds);
    assertEquals(9, ulSummary.totalBadQualityDurationInSeconds);
    assertEquals(14, ulSummary.totalDurationWithQualityInformationInSeconds);
}
Also used : CallQuality(android.telephony.CallQuality) CallQualitySummary(com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.CallQualitySummary) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test)

Example 7 with CallQualitySummary

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

the class CallQualityMetricsTest method testNotAvailableIsIgnored.

/**
 * Verify that if either UL or DL call quality level is not available, the CallQuality update is
 * ignored.
 */
@Test
public void testNotAvailableIsIgnored() {
    // CallQuality updates from the IMS service with CALL_QUALITY_NOT_AVAILABLE should be
    // ignored
    CallQuality cq1 = constructCallQuality(CallQuality.CALL_QUALITY_NOT_AVAILABLE, CallQuality.CALL_QUALITY_BAD, 5000);
    CallQuality cq2 = constructCallQuality(CallQuality.CALL_QUALITY_BAD, CallQuality.CALL_QUALITY_NOT_AVAILABLE, 10000);
    mCallQualityMetrics.saveCallQuality(cq1);
    mCallQualityMetrics.saveCallQuality(cq2);
    CallQualitySummary dlSummary = mCallQualityMetrics.getCallQualitySummaryDl();
    assertEquals(0, dlSummary.totalGoodQualityDurationInSeconds);
    assertEquals(0, dlSummary.totalBadQualityDurationInSeconds);
    assertEquals(0, dlSummary.totalDurationWithQualityInformationInSeconds);
    CallQualitySummary ulSummary = mCallQualityMetrics.getCallQualitySummaryUl();
    assertEquals(0, ulSummary.totalGoodQualityDurationInSeconds);
    assertEquals(0, ulSummary.totalBadQualityDurationInSeconds);
    assertEquals(0, ulSummary.totalDurationWithQualityInformationInSeconds);
}
Also used : CallQuality(android.telephony.CallQuality) CallQualitySummary(com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.CallQualitySummary) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test)

Example 8 with CallQualitySummary

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

the class CallQualityMetricsTest method testNoQualityReported.

/**
 * Verify that a new CallQualityMetrics object is able to return empty summaries if no
 * CallQuality is reported for the duration of a call.
 */
@Test
public void testNoQualityReported() {
    // getting the summary for a new CallQualityMetrics object should not fail, and all
    // durations should be 0
    CallQualitySummary dlSummary = mCallQualityMetrics.getCallQualitySummaryDl();
    assertEquals(0, dlSummary.totalGoodQualityDurationInSeconds);
    assertEquals(0, dlSummary.totalBadQualityDurationInSeconds);
    assertEquals(0, dlSummary.totalDurationWithQualityInformationInSeconds);
    CallQualitySummary ulSummary = mCallQualityMetrics.getCallQualitySummaryUl();
    assertEquals(0, ulSummary.totalGoodQualityDurationInSeconds);
    assertEquals(0, ulSummary.totalBadQualityDurationInSeconds);
    assertEquals(0, ulSummary.totalDurationWithQualityInformationInSeconds);
}
Also used : CallQualitySummary(com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.CallQualitySummary) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test)

Example 9 with CallQualitySummary

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

the class CallQualityMetricsTest method testSnapshotOfEndDuration_ReportedOutOfOrder.

/**
 * Verifies that the snapshot of the end (the last reported call quality) is correct.
 * Currently this just checks the duration since the logic is all the same and it doesn't seem
 * likely that one field would be preserved and others would be lost.
 *
 * Similar to testSnapshotOfEndDuration but we report the call quality out of order
 */
@Test
public void testSnapshotOfEndDuration_ReportedOutOfOrder() {
    CallQuality cq1 = constructCallQuality(CallQuality.CALL_QUALITY_EXCELLENT, CallQuality.CALL_QUALITY_BAD, 5000);
    CallQuality cq2 = constructCallQuality(CallQuality.CALL_QUALITY_BAD, CallQuality.CALL_QUALITY_EXCELLENT, 10000);
    CallQuality cq3 = constructCallQuality(CallQuality.CALL_QUALITY_EXCELLENT, CallQuality.CALL_QUALITY_BAD, 14000);
    mCallQualityMetrics.saveCallQuality(cq1);
    mCallQualityMetrics.saveCallQuality(cq3);
    mCallQualityMetrics.saveCallQuality(cq2);
    // verify snapshot of end
    CallQualitySummary dlSummary = mCallQualityMetrics.getCallQualitySummaryDl();
    assertEquals(14, dlSummary.snapshotOfEnd.durationInSeconds);
    CallQualitySummary ulSummary = mCallQualityMetrics.getCallQualitySummaryUl();
    assertEquals(14, ulSummary.snapshotOfEnd.durationInSeconds);
}
Also used : CallQuality(android.telephony.CallQuality) CallQualitySummary(com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.CallQualitySummary) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test)

Aggregations

TelephonyTest (com.android.internal.telephony.TelephonyTest)9 CallQualitySummary (com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.CallQualitySummary)9 Test (org.junit.Test)9 CallQuality (android.telephony.CallQuality)7 CellSignalStrengthCdma (android.telephony.CellSignalStrengthCdma)1 CellSignalStrengthGsm (android.telephony.CellSignalStrengthGsm)1 CellSignalStrengthLte (android.telephony.CellSignalStrengthLte)1 CellSignalStrengthNr (android.telephony.CellSignalStrengthNr)1 CellSignalStrengthTdscdma (android.telephony.CellSignalStrengthTdscdma)1 CellSignalStrengthWcdma (android.telephony.CellSignalStrengthWcdma)1 SignalStrength (android.telephony.SignalStrength)1 SmallTest (android.test.suitebuilder.annotation.SmallTest)1 CallQuality (com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.CallQuality)1 SignalStrength (com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.SignalStrength)1