use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.
the class ServiceStateTrackerTest method test5gNrSignalStrengthReportingCriteria_UseSsRsrp.
@Test
public void test5gNrSignalStrengthReportingCriteria_UseSsRsrp() {
SignalStrength ss = new SignalStrength(new CellSignalStrengthCdma(), new CellSignalStrengthGsm(), new CellSignalStrengthWcdma(), new CellSignalStrengthTdscdma(), new CellSignalStrengthLte(), new CellSignalStrengthNr(-139, /**
* csiRsrp NONE
*/
-20, /**
* csiRsrq NONE
*/
-23, /**
* CsiSinr NONE
*/
-44, /**
* SsRsrp SIGNAL_STRENGTH_GREAT
*/
-20, /**
* SsRsrq NONE
*/
-23));
// SSRSRP = 1 << 0
mBundle.putInt(CarrierConfigManager.KEY_PARAMETERS_USE_FOR_5G_NR_SIGNAL_BAR_INT, CellSignalStrengthNr.USE_SSRSRP);
sendCarrierConfigUpdate();
mSimulatedCommands.setSignalStrength(ss);
mSimulatedCommands.notifySignalStrength();
waitForLastHandlerAction(mSSTTestHandler.getThreadHandler());
assertEquals(CellSignalStrength.SIGNAL_STRENGTH_GREAT, sst.getSignalStrength().getLevel());
}
use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.
the class ServiceStateTrackerTest method testWcdmaSignalStrengthReportingCriteria.
@Test
public void testWcdmaSignalStrengthReportingCriteria() {
SignalStrength ss = new SignalStrength(new CellSignalStrengthCdma(), new CellSignalStrengthGsm(), new CellSignalStrengthWcdma(-79, 0, -85, -5), new CellSignalStrengthTdscdma(), new CellSignalStrengthLte(), new CellSignalStrengthNr());
mSimulatedCommands.setSignalStrength(ss);
mSimulatedCommands.notifySignalStrength();
waitForLastHandlerAction(mSSTTestHandler.getThreadHandler());
assertEquals(sst.getSignalStrength().getLevel(), CellSignalStrength.SIGNAL_STRENGTH_GOOD);
int[] wcdmaThresholds = { // SIGNAL_STRENGTH_POOR
-110, // SIGNAL_STRENGTH_MODERATE
-100, // SIGNAL_STRENGTH_GOOD
-90, // SIGNAL_STRENGTH_GREAT
-80 };
mBundle.putIntArray(CarrierConfigManager.KEY_WCDMA_RSCP_THRESHOLDS_INT_ARRAY, wcdmaThresholds);
mBundle.putString(CarrierConfigManager.KEY_WCDMA_DEFAULT_SIGNAL_STRENGTH_MEASUREMENT_STRING, "rscp");
sendCarrierConfigUpdate();
mSimulatedCommands.setSignalStrength(ss);
mSimulatedCommands.notifySignalStrength();
waitForLastHandlerAction(mSSTTestHandler.getThreadHandler());
assertEquals(sst.getSignalStrength().getLevel(), CellSignalStrength.SIGNAL_STRENGTH_GOOD);
}
use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.
the class SignalStrengthTest method createSignalStrengthLteReportRssnr.
private static SignalStrength createSignalStrengthLteReportRssnr(int lteRsrp, int lteRssnr) {
CellSignalStrengthLte lte = new CellSignalStrengthLte(// rssi
-89, // rsrp
lteRsrp, // rsrq
15, // rssnr
lteRssnr, // cqi
CellInfo.UNAVAILABLE, // timingAdvance
CellInfo.UNAVAILABLE);
SignalStrength signalStrength = new SignalStrength(new CellSignalStrengthCdma(), new CellSignalStrengthGsm(), new CellSignalStrengthWcdma(), new CellSignalStrengthTdscdma(), lte, new CellSignalStrengthNr());
PersistableBundle bundle = new PersistableBundle();
bundle.putInt(CarrierConfigManager.KEY_PARAMETERS_USED_FOR_LTE_SIGNAL_BAR_INT, CellSignalStrengthLte.USE_RSRP | CellSignalStrengthLte.USE_RSSNR);
bundle.putIntArray(CarrierConfigManager.KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY, DEFAULT_LTE_RSRP_THRESHOLDS);
bundle.putIntArray(CarrierConfigManager.KEY_LTE_RSSNR_THRESHOLDS_INT_ARRAY, DEFAULT_LTE_RSSNR_THRESHOLDS);
signalStrength.updateLevel(bundle, null);
return signalStrength;
}
use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.
the class SignalStrengthTest method testGetCellSignalStrengths.
@Test
public void testGetCellSignalStrengths() throws Exception {
CellSignalStrengthLte lte = new CellSignalStrengthLte(-85, -91, -6, -10, 12, 1);
CellSignalStrengthGsm gsm = new CellSignalStrengthGsm(-79, 2, 5);
CellSignalStrengthCdma cdma = new CellSignalStrengthCdma(-93, -132, -89, -125, 5);
CellSignalStrengthWcdma wcdma = new CellSignalStrengthWcdma(-94, 4, -102, -5);
CellSignalStrengthTdscdma tdscdma = new CellSignalStrengthTdscdma(-95, 2, -103);
// Test that a single object is properly stored and returned by getCellSignalStrengths()
SignalStrength s = new SignalStrength(new CellSignalStrengthCdma(), gsm, new CellSignalStrengthWcdma(), new CellSignalStrengthTdscdma(), new CellSignalStrengthLte(), new CellSignalStrengthNr());
List<CellSignalStrength> css = s.getCellSignalStrengths();
assertEquals(1, css.size());
assertTrue(gsm.equals(css.get(0)));
// Test that a multiple objects are properly stored and returned by getCellSignalStrengths()
s = new SignalStrength(cdma, new CellSignalStrengthGsm(), new CellSignalStrengthWcdma(), new CellSignalStrengthTdscdma(), lte, new CellSignalStrengthNr());
css = s.getCellSignalStrengths();
assertEquals(2, css.size());
assertTrue(css.contains(cdma));
assertTrue(css.contains(lte));
}
use of android.telephony.CellSignalStrengthNr 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);
}
Aggregations