use of android.telephony.CellSignalStrengthTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class SignalStrengthTest method testParcelUnparcel.
@Test
public void testParcelUnparcel() throws Exception {
assertParcelingIsLossless(new SignalStrength());
SignalStrength s = new SignalStrength(new CellSignalStrengthCdma(-93, -132, -89, -125, 5), new CellSignalStrengthGsm(-79, 2, 5), new CellSignalStrengthWcdma(-94, 4, -102, -5), new CellSignalStrengthTdscdma(-95, 2, -103), new CellSignalStrengthLte(-85, -91, -6, -10, 12, 1), new CellSignalStrengthNr(-91, -6, 3, -80, -7, 4));
assertParcelingIsLossless(s);
PersistableBundle bundle = new PersistableBundle();
bundle.putIntArray(CarrierConfigManager.KEY_LTE_RSRQ_THRESHOLDS_INT_ARRAY, DEFAULT_LTE_RSRQ_THRESHOLDS);
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);
bundle.putIntArray(CarrierConfigManager.KEY_5G_NR_SSRSRP_THRESHOLDS_INT_ARRAY, DEFAULT_5G_NR_SSRSRP_THRESHOLDS);
s.updateLevel(bundle, null);
assertParcelingIsLossless(s);
}
use of android.telephony.CellSignalStrengthTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class SignalStrengthTest method createSignalStrengthLteReportRsrq.
private static SignalStrength createSignalStrengthLteReportRsrq(int lteRsrp, int lteRsrq) {
CellSignalStrengthLte lte = new CellSignalStrengthLte(// rssi
-89, // rsrp
lteRsrp, // rsrq
lteRsrq, // rssnr
-25, // 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_RSRQ);
bundle.putIntArray(CarrierConfigManager.KEY_LTE_RSRQ_THRESHOLDS_INT_ARRAY, DEFAULT_LTE_RSRQ_THRESHOLDS);
bundle.putIntArray(CarrierConfigManager.KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY, DEFAULT_LTE_RSRP_THRESHOLDS);
signalStrength.updateLevel(bundle, null);
return signalStrength;
}
use of android.telephony.CellSignalStrengthTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class RIL method fixupSignalStrength10.
/**
* Fixup for SignalStrength 1.0 to Assume GSM to WCDMA when
* The current RAT type is one of the UMTS RATs.
* @param signalStrength the initial signal strength
* @return a new SignalStrength if RAT is UMTS or existing SignalStrength
*/
public SignalStrength fixupSignalStrength10(SignalStrength signalStrength) {
List<CellSignalStrengthGsm> gsmList = signalStrength.getCellSignalStrengths(CellSignalStrengthGsm.class);
// If GSM is not the primary type, then bail out; no fixup needed.
if (gsmList.isEmpty() || !gsmList.get(0).isValid()) {
return signalStrength;
}
CellSignalStrengthGsm gsmStrength = gsmList.get(0);
// Use the voice RAT which is a guarantee in GSM and UMTS
int voiceRat = ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN;
Phone phone = PhoneFactory.getPhone(mPhoneId);
if (phone != null) {
ServiceState ss = phone.getServiceState();
if (ss != null) {
voiceRat = ss.getRilVoiceRadioTechnology();
}
}
switch(voiceRat) {
case ServiceState.RIL_RADIO_TECHNOLOGY_GPRS:
/* fallthrough */
case ServiceState.RIL_RADIO_TECHNOLOGY_EDGE:
/* fallthrough */
case ServiceState.RIL_RADIO_TECHNOLOGY_UMTS:
/* fallthrough */
case ServiceState.RIL_RADIO_TECHNOLOGY_HSDPA:
/* fallthrough */
case ServiceState.RIL_RADIO_TECHNOLOGY_HSUPA:
/* fallthrough */
case ServiceState.RIL_RADIO_TECHNOLOGY_HSPA:
/* fallthrough */
case ServiceState.RIL_RADIO_TECHNOLOGY_HSPAP:
/* fallthrough */
case ServiceState.RIL_RADIO_TECHNOLOGY_GSM:
/* fallthrough */
break;
default:
// If we are not currently on WCDMA/HSPA, then we don't need to do a fixup.
return signalStrength;
}
// GSM report to the WCDMA report, leaving everything else empty.
return new SignalStrength(new CellSignalStrengthCdma(), new CellSignalStrengthGsm(), new CellSignalStrengthWcdma(gsmStrength.getRssi(), gsmStrength.getBitErrorRate(), CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE), new CellSignalStrengthTdscdma(), new CellSignalStrengthLte(), new CellSignalStrengthNr());
}
use of android.telephony.CellSignalStrengthTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class CellSignalStrengthTdscdmaTest method testDefaultConstructor.
@SmallTest
public void testDefaultConstructor() {
CellSignalStrengthTdscdma css = new CellSignalStrengthTdscdma();
assertEquals(CellInfo.UNAVAILABLE, css.getRssi());
assertEquals(CellInfo.UNAVAILABLE, css.getBitErrorRate());
assertEquals(CellInfo.UNAVAILABLE, css.getRscp());
}
Aggregations