use of android.telephony.CallQuality in project android_frameworks_opt_telephony by LineageOS.
the class CallAttributesTest method testParcelUnparcelPreciseCallState.
@SmallTest
public void testParcelUnparcelPreciseCallState() {
CallQuality quality = new CallQuality();
PreciseCallState pcs = new PreciseCallState();
CallAttributes data = new CallAttributes(pcs, 10, quality);
Parcel parcel = Parcel.obtain();
data.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
CallAttributes unparceledData = CallAttributes.CREATOR.createFromParcel(parcel);
parcel.recycle();
assertEquals("PreciseCallState is not equal after parceled/unparceled", data.getPreciseCallState(), unparceledData.getPreciseCallState());
}
use of android.telephony.CallQuality in project android_frameworks_opt_telephony by LineageOS.
the class CallAttributesTest method testParcelUnparcelNetworkType.
@SmallTest
public void testParcelUnparcelNetworkType() {
CallQuality quality = new CallQuality();
PreciseCallState pcs = new PreciseCallState();
CallAttributes data = new CallAttributes(pcs, 10, quality);
Parcel parcel = Parcel.obtain();
data.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
CallAttributes unparceledData = CallAttributes.CREATOR.createFromParcel(parcel);
parcel.recycle();
assertEquals("NetworkType is not equal after parceled/unparceled", data.getNetworkType(), unparceledData.getNetworkType());
}
use of android.telephony.CallQuality in project android_frameworks_opt_telephony by LineageOS.
the class CallQualityTest method testParcelUnparcelCallQuality.
@SmallTest
@Test
public void testParcelUnparcelCallQuality() {
CallQuality quality = new CallQuality(1, /* downlinkCallQualityLevel */
2, /* uplinkCallQualityLevel */
4000, /* callDuration */
500, /* numRtpPacketsTransmitted */
600, /* numRtpPacketsReceived */
70, /* numRtpPacketsTransmittedLost */
42, /* numRtpPacketsNotReceived */
30, /* averageRelativeJitter */
40, /* maxRelativeJitter */
100, /* averageRoundTripTime */
1);
Parcel parcel = Parcel.obtain();
quality.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
CallQuality unparceledData = CallQuality.CREATOR.createFromParcel(parcel);
parcel.recycle();
assertEquals("CallQuality is not equal after parceled/unparceled", quality, unparceledData);
}
use of android.telephony.CallQuality in project android_frameworks_opt_telephony by LineageOS.
the class CallQualityMetricsTest method testBestAndWorstSs.
/**
* Test that the best and worst SignalStrength (currently just LTE RSSNR) is correctly kept
* track of. CallQualityMetrics should log the best and worst SS for good and bad quality, but
* this just tests for good quality since the logic is the same.
*/
@Test
public void testBestAndWorstSs() {
// save good quality with high rssnr
CallQuality cq1 = constructCallQuality(CallQuality.CALL_QUALITY_EXCELLENT, CallQuality.CALL_QUALITY_EXCELLENT, 5000);
int rssnr1 = 30;
// ignore everything except rssnr
CellSignalStrengthLte lteSs1 = new CellSignalStrengthLte(0, 0, 0, rssnr1, 0, 0);
SignalStrength ss1 = new SignalStrength(new CellSignalStrengthCdma(), new CellSignalStrengthGsm(), new CellSignalStrengthWcdma(), new CellSignalStrengthTdscdma(), lteSs1, new CellSignalStrengthNr());
when(mSST.getSignalStrength()).thenReturn(ss1);
mCallQualityMetrics.saveCallQuality(cq1);
// save good quality with low rssnr
CallQuality cq2 = constructCallQuality(CallQuality.CALL_QUALITY_EXCELLENT, CallQuality.CALL_QUALITY_EXCELLENT, 10000);
int rssnr2 = -20;
// ignore everything except rssnr
CellSignalStrengthLte lteSs2 = new CellSignalStrengthLte(0, 0, 0, rssnr2, 0, 0);
SignalStrength ss2 = new SignalStrength(new CellSignalStrengthCdma(), new CellSignalStrengthGsm(), new CellSignalStrengthWcdma(), new CellSignalStrengthTdscdma(), lteSs2, new CellSignalStrengthNr());
when(mSST.getSignalStrength()).thenReturn(ss2);
mCallQualityMetrics.saveCallQuality(cq1);
CallQualitySummary dlSummary = mCallQualityMetrics.getCallQualitySummaryDl();
assertEquals(rssnr1, dlSummary.bestSsWithGoodQuality.lteSnr);
assertEquals(rssnr2, dlSummary.worstSsWithGoodQuality.lteSnr);
}
use of android.telephony.CallQuality in project android_frameworks_opt_telephony by LineageOS.
the class CallQualityMetricsTest method testSnapshotOfEndDuration.
/**
* 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.
*/
@Test
public void testSnapshotOfEndDuration() {
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(cq2);
mCallQualityMetrics.saveCallQuality(cq3);
// verify snapshot of end
CallQualitySummary dlSummary = mCallQualityMetrics.getCallQualitySummaryDl();
assertEquals(14, dlSummary.snapshotOfEnd.durationInSeconds);
CallQualitySummary ulSummary = mCallQualityMetrics.getCallQualitySummaryUl();
assertEquals(14, ulSummary.snapshotOfEnd.durationInSeconds);
}
Aggregations