Search in sources :

Example 6 with CellSignalStrengthTdscdma

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());
}
Also used : CellSignalStrengthLte(android.telephony.CellSignalStrengthLte) CellSignalStrengthGsm(android.telephony.CellSignalStrengthGsm) CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) CellSignalStrengthWcdma(android.telephony.CellSignalStrengthWcdma) CellSignalStrengthTdscdma(android.telephony.CellSignalStrengthTdscdma) CellSignalStrengthCdma(android.telephony.CellSignalStrengthCdma) CellSignalStrength(android.telephony.CellSignalStrength) SignalStrength(android.telephony.SignalStrength) FlakyTest(androidx.test.filters.FlakyTest) MediumTest(android.test.suitebuilder.annotation.MediumTest) SmallTest(android.test.suitebuilder.annotation.SmallTest) Test(org.junit.Test)

Example 7 with CellSignalStrengthTdscdma

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());
}
Also used : CellSignalStrengthLte(android.telephony.CellSignalStrengthLte) CellSignalStrengthGsm(android.telephony.CellSignalStrengthGsm) CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) CellSignalStrengthWcdma(android.telephony.CellSignalStrengthWcdma) CellSignalStrengthTdscdma(android.telephony.CellSignalStrengthTdscdma) CellSignalStrengthCdma(android.telephony.CellSignalStrengthCdma) CellSignalStrength(android.telephony.CellSignalStrength) SignalStrength(android.telephony.SignalStrength) FlakyTest(androidx.test.filters.FlakyTest) MediumTest(android.test.suitebuilder.annotation.MediumTest) SmallTest(android.test.suitebuilder.annotation.SmallTest) Test(org.junit.Test)

Example 8 with CellSignalStrengthTdscdma

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());
}
Also used : CellSignalStrengthLte(android.telephony.CellSignalStrengthLte) CellSignalStrengthGsm(android.telephony.CellSignalStrengthGsm) CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) CellSignalStrengthWcdma(android.telephony.CellSignalStrengthWcdma) CellSignalStrengthTdscdma(android.telephony.CellSignalStrengthTdscdma) CellSignalStrengthCdma(android.telephony.CellSignalStrengthCdma) CellSignalStrength(android.telephony.CellSignalStrength) SignalStrength(android.telephony.SignalStrength) FlakyTest(androidx.test.filters.FlakyTest) MediumTest(android.test.suitebuilder.annotation.MediumTest) SmallTest(android.test.suitebuilder.annotation.SmallTest) Test(org.junit.Test)

Example 9 with CellSignalStrengthTdscdma

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);
}
Also used : CellSignalStrengthLte(android.telephony.CellSignalStrengthLte) CellSignalStrengthGsm(android.telephony.CellSignalStrengthGsm) CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) CellSignalStrengthWcdma(android.telephony.CellSignalStrengthWcdma) CellSignalStrengthTdscdma(android.telephony.CellSignalStrengthTdscdma) CellSignalStrengthCdma(android.telephony.CellSignalStrengthCdma) CellSignalStrength(android.telephony.CellSignalStrength) SignalStrength(android.telephony.SignalStrength) FlakyTest(androidx.test.filters.FlakyTest) MediumTest(android.test.suitebuilder.annotation.MediumTest) SmallTest(android.test.suitebuilder.annotation.SmallTest) Test(org.junit.Test)

Example 10 with CellSignalStrengthTdscdma

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;
}
Also used : CellSignalStrengthLte(android.telephony.CellSignalStrengthLte) PersistableBundle(android.os.PersistableBundle) CellSignalStrengthGsm(android.telephony.CellSignalStrengthGsm) CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) CellSignalStrengthWcdma(android.telephony.CellSignalStrengthWcdma) CellSignalStrengthTdscdma(android.telephony.CellSignalStrengthTdscdma) CellSignalStrengthCdma(android.telephony.CellSignalStrengthCdma) SignalStrength(android.telephony.SignalStrength) CellSignalStrength(android.telephony.CellSignalStrength)

Aggregations

CellSignalStrengthTdscdma (android.telephony.CellSignalStrengthTdscdma)19 CellSignalStrengthCdma (android.telephony.CellSignalStrengthCdma)13 CellSignalStrengthGsm (android.telephony.CellSignalStrengthGsm)13 CellSignalStrengthLte (android.telephony.CellSignalStrengthLte)13 CellSignalStrengthNr (android.telephony.CellSignalStrengthNr)13 CellSignalStrengthWcdma (android.telephony.CellSignalStrengthWcdma)13 SignalStrength (android.telephony.SignalStrength)13 SmallTest (android.test.suitebuilder.annotation.SmallTest)11 Test (org.junit.Test)11 CellSignalStrength (android.telephony.CellSignalStrength)10 FlakyTest (androidx.test.filters.FlakyTest)8 MediumTest (android.test.suitebuilder.annotation.MediumTest)6 PersistableBundle (android.os.PersistableBundle)3 SmallTest (androidx.test.filters.SmallTest)2 Parcel (android.os.Parcel)1 CallQuality (android.telephony.CallQuality)1 CellIdentityTdscdma (android.telephony.CellIdentityTdscdma)1 CellInfo (android.telephony.CellInfo)1 CellInfoTdscdma (android.telephony.CellInfoTdscdma)1 ServiceState (android.telephony.ServiceState)1