use of android.telephony.CellSignalStrengthTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class ServiceStateTrackerTest method test5gNrSignalStrengthReportingCriteria_ConfiguredThresholds.
@Test
public void test5gNrSignalStrengthReportingCriteria_ConfiguredThresholds() {
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());
int[] nrSsRsrpThresholds = { // SIGNAL_STRENGTH_POOR
-45, // SIGNAL_STRENGTH_MODERATE
-40, // SIGNAL_STRENGTH_GOOD
-37, // SIGNAL_STRENGTH_GREAT
-34 };
mBundle.putIntArray(CarrierConfigManager.KEY_5G_NR_SSRSRP_THRESHOLDS_INT_ARRAY, nrSsRsrpThresholds);
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_POOR, sst.getSignalStrength().getLevel());
}
use of android.telephony.CellSignalStrengthTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class ServiceStateTrackerTest method test5gNrSignalStrengthReportingCriteria_UseSsRsrpAndSsRsrq.
@Test
public void test5gNrSignalStrengthReportingCriteria_UseSsRsrpAndSsRsrq() {
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
*/
-32, /**
* SsRsrq NONE
*/
-23));
// SSRSRP = 1 << 0 | SSSINR = 1 << 2
mBundle.putInt(CarrierConfigManager.KEY_PARAMETERS_USE_FOR_5G_NR_SIGNAL_BAR_INT, CellSignalStrengthNr.USE_SSRSRP | CellSignalStrengthNr.USE_SSRSRQ);
sendCarrierConfigUpdate();
mSimulatedCommands.setSignalStrength(ss);
mSimulatedCommands.notifySignalStrength();
waitForLastHandlerAction(mSSTTestHandler.getThreadHandler());
assertEquals(CellSignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN, sst.getSignalStrength().getLevel());
}
use of android.telephony.CellSignalStrengthTdscdma 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.CellSignalStrengthTdscdma 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.CellSignalStrengthTdscdma 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;
}
Aggregations