use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.
the class CellSignalStrengthNrTest method testAsuLevel_invalidValue.
@Test
public void testAsuLevel_invalidValue() {
// GIVEN an instance of CellSignalStrengthNr with invalid csirsrp
CellSignalStrengthNr css = new CellSignalStrengthNr(CSIRSRP, CSIRSRQ, CSISINR, INVALID_SSRSRP, SSRSRQ, SSSINR);
// THEN the asu level is unknown
assertThat(css.getAsuLevel()).isEqualTo(CellSignalStrengthNr.UNKNOWN_ASU_LEVEL);
}
use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.
the class CellSignalStrengthNrTest method testSignalLevel_invalidValue.
@Test
public void testSignalLevel_invalidValue() {
// GIVEN an instance of CellSignalStrengthNr with invalid csirsrp
CellSignalStrengthNr css = new CellSignalStrengthNr(CSIRSRP, CSIRSRQ, CSISINR, INVALID_SSRSRP, SSRSRQ, SSSINR);
// THEN the signal level is unknown
assertThat(css.getLevel()).isEqualTo(CellSignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN);
}
use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.
the class RILTest method testConvertHalCellInfoList_1_4ForNr.
@Test
public void testConvertHalCellInfoList_1_4ForNr() {
android.hardware.radio.V1_4.CellInfoNr cellinfo = new android.hardware.radio.V1_4.CellInfoNr();
cellinfo.cellidentity.nci = CI;
cellinfo.cellidentity.pci = PCI;
cellinfo.cellidentity.tac = TAC;
cellinfo.cellidentity.nrarfcn = NRARFCN;
cellinfo.cellidentity.mcc = MCC_STR;
cellinfo.cellidentity.mnc = MNC_STR;
cellinfo.cellidentity.operatorNames.alphaLong = ALPHA_LONG;
cellinfo.cellidentity.operatorNames.alphaShort = ALPHA_SHORT;
cellinfo.signalStrength.ssRsrp = RSRP;
cellinfo.signalStrength.ssRsrq = RSRQ;
cellinfo.signalStrength.ssSinr = SIGNAL_NOISE_RATIO;
cellinfo.signalStrength.csiRsrp = RSRP;
cellinfo.signalStrength.csiRsrq = RSRQ;
cellinfo.signalStrength.csiSinr = SIGNAL_NOISE_RATIO;
android.hardware.radio.V1_4.CellInfo record = new android.hardware.radio.V1_4.CellInfo();
record.info.nr(cellinfo);
ArrayList<android.hardware.radio.V1_4.CellInfo> records = new ArrayList<>();
records.add(record);
ArrayList<CellInfo> ret = RIL.convertHalCellInfoList_1_4(records);
CellInfoNr cellInfoNr = (CellInfoNr) ret.get(0);
CellIdentityNr cellIdentityNr = (CellIdentityNr) cellInfoNr.getCellIdentity();
CellSignalStrengthNr signalStrengthNr = (CellSignalStrengthNr) cellInfoNr.getCellSignalStrength();
CellIdentityNr expectedCellIdentity = new CellIdentityNr(PCI, TAC, NRARFCN, new int[] {}, MCC_STR, MNC_STR, CI, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList());
CellSignalStrengthNr expectedSignalStrength = new CellSignalStrengthNr(-RSRP, -RSRQ, SIGNAL_NOISE_RATIO, -RSRP, -RSRQ, SIGNAL_NOISE_RATIO);
assertEquals(expectedCellIdentity, cellIdentityNr);
assertEquals(expectedSignalStrength, signalStrengthNr);
}
use of android.telephony.CellSignalStrengthNr 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.CellSignalStrengthNr 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());
}
Aggregations