Search in sources :

Example 11 with CellSignalStrengthNr

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());
}
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 12 with CellSignalStrengthNr

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);
}
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 13 with CellSignalStrengthNr

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;
}
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)

Example 14 with CellSignalStrengthNr

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

Example 15 with CellSignalStrengthNr

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);
}
Also used : CellSignalStrengthLte(android.telephony.CellSignalStrengthLte) CallQuality(android.telephony.CallQuality) CellSignalStrengthGsm(android.telephony.CellSignalStrengthGsm) CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) CellSignalStrengthWcdma(android.telephony.CellSignalStrengthWcdma) CellSignalStrengthTdscdma(android.telephony.CellSignalStrengthTdscdma) CallQualitySummary(com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.CallQualitySummary) CellSignalStrengthCdma(android.telephony.CellSignalStrengthCdma) SignalStrength(android.telephony.SignalStrength) TelephonyTest(com.android.internal.telephony.TelephonyTest) Test(org.junit.Test)

Aggregations

CellSignalStrengthNr (android.telephony.CellSignalStrengthNr)24 Test (org.junit.Test)21 CellSignalStrengthCdma (android.telephony.CellSignalStrengthCdma)13 CellSignalStrengthGsm (android.telephony.CellSignalStrengthGsm)13 CellSignalStrengthLte (android.telephony.CellSignalStrengthLte)13 CellSignalStrengthTdscdma (android.telephony.CellSignalStrengthTdscdma)13 CellSignalStrengthWcdma (android.telephony.CellSignalStrengthWcdma)13 SignalStrength (android.telephony.SignalStrength)13 CellSignalStrength (android.telephony.CellSignalStrength)10 FlakyTest (androidx.test.filters.FlakyTest)8 MediumTest (android.test.suitebuilder.annotation.MediumTest)6 SmallTest (android.test.suitebuilder.annotation.SmallTest)6 PersistableBundle (android.os.PersistableBundle)3 NrSignalStrength (android.hardware.radio.V1_4.NrSignalStrength)2 SmallTest (androidx.test.filters.SmallTest)2 Parcel (android.os.Parcel)1 CallQuality (android.telephony.CallQuality)1 CellIdentityNr (android.telephony.CellIdentityNr)1 CellInfo (android.telephony.CellInfo)1 CellInfoNr (android.telephony.CellInfoNr)1