Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6925946 authored by Sarah Kim's avatar Sarah Kim Committed by Automerger Merge Worker
Browse files

Merge "ServiceStateTracker consider config for combined bandwidth" into...

Merge "ServiceStateTracker consider config for combined bandwidth" into udc-dev am: 393f876d am: 97c9b39c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/23162450



Change-Id: Id5d0c1cd1051b324736eb7a8b7ffc782d6e76caa
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 85bd2e98 97c9b39c
Loading
Loading
Loading
Loading
+11 −13
Original line number Diff line number Diff line
@@ -1696,16 +1696,9 @@ public class ServiceStateTracker extends Handler {
                                .findFirst()
                                .orElse(PhysicalChannelConfig.PHYSICAL_CELL_ID_UNKNOWN);
                    }
                    boolean includeLte = mCarrierConfig.getBoolean(CarrierConfigManager
                            .KEY_INCLUDE_LTE_FOR_NR_ADVANCED_THRESHOLD_BANDWIDTH_BOOL);
                    int[] bandwidths = new int[0];
                    if (list != null) {
                        bandwidths = list.stream()
                                .filter(config -> includeLte || config.getNetworkType()
                                        == TelephonyManager.NETWORK_TYPE_NR)
                                .map(PhysicalChannelConfig::getCellBandwidthDownlinkKhz)
                                .mapToInt(Integer::intValue)
                                .toArray();
                        bandwidths = getBandwidthsFromLastPhysicalChannelConfigs();
                    }
                    if (anchorNrCellId == mLastAnchorNrCellId
                            && anchorNrCellId != PhysicalChannelConfig.PHYSICAL_CELL_ID_UNKNOWN) {
@@ -1713,7 +1706,8 @@ public class ServiceStateTracker extends Handler {
                        hasChanged |= RatRatcheter.updateBandwidths(bandwidths, mSS);
                    } else {
                        log("Do not ratchet bandwidths since anchor NR cell is different ("
                                + mLastAnchorNrCellId + "->" + anchorNrCellId + ").");
                                + mLastAnchorNrCellId + " -> " + anchorNrCellId
                                + "). New bandwidths are " + Arrays.toString(bandwidths));
                        mLastAnchorNrCellId = anchorNrCellId;
                        hasChanged |= !Arrays.equals(mSS.getCellBandwidths(), bandwidths);
                        mSS.setCellBandwidths(bandwidths);
@@ -1797,8 +1791,12 @@ public class ServiceStateTracker extends Handler {
        return simAbsent;
    }

    private static int[] getBandwidthsFromConfigs(List<PhysicalChannelConfig> list) {
        return list.stream()
    private int[] getBandwidthsFromLastPhysicalChannelConfigs() {
        boolean includeLte = mCarrierConfig.getBoolean(
                CarrierConfigManager.KEY_INCLUDE_LTE_FOR_NR_ADVANCED_THRESHOLD_BANDWIDTH_BOOL);
        return mLastPhysicalChannelConfigList.stream()
                .filter(config -> includeLte
                        || config.getNetworkType() == TelephonyManager.NETWORK_TYPE_NR)
                .map(PhysicalChannelConfig::getCellBandwidthDownlinkKhz)
                .mapToInt(Integer::intValue)
                .toArray();
@@ -2558,7 +2556,7 @@ public class ServiceStateTracker extends Handler {
            // Prioritize the PhysicalChannelConfig list because we might already be in carrier
            // aggregation by the time poll state is performed.
            if (primaryPcc != null) {
                bandwidths = getBandwidthsFromConfigs(mLastPhysicalChannelConfigList);
                bandwidths = getBandwidthsFromLastPhysicalChannelConfigs();
                for (int bw : bandwidths) {
                    if (!isValidLteBandwidthKhz(bw)) {
                        loge("Invalid LTE Bandwidth in RegistrationState, " + bw);
@@ -2594,7 +2592,7 @@ public class ServiceStateTracker extends Handler {
            // Prioritize the PhysicalChannelConfig list because we might already be in carrier
            // aggregation by the time poll state is performed.
            if (primaryPcc != null) {
                bandwidths = getBandwidthsFromConfigs(mLastPhysicalChannelConfigList);
                bandwidths = getBandwidthsFromLastPhysicalChannelConfigs();
                for (int bw : bandwidths) {
                    if (!isValidNrBandwidthKhz(bw)) {
                        loge("Invalid NR Bandwidth in RegistrationState, " + bw);
+6 −4
Original line number Diff line number Diff line
@@ -375,6 +375,9 @@ public class ServiceStateTrackerTest extends TelephonyTest {
                    15, /* SIGNAL_STRENGTH_GOOD */
                    30  /* SIGNAL_STRENGTH_GREAT */
                });
        mBundle.putBoolean(
                CarrierConfigManager.KEY_INCLUDE_LTE_FOR_NR_ADVANCED_THRESHOLD_BANDWIDTH_BOOL,
                true);

        sendCarrierConfigUpdate(PHONE_ID);
        waitForLastHandlerAction(mSSTTestHandler.getThreadHandler());
@@ -2315,10 +2318,6 @@ public class ServiceStateTrackerTest extends TelephonyTest {

    @Test
    public void testPhyChanBandwidthRatchetedOnPhyChanBandwidth() {
        mBundle.putBoolean(
                CarrierConfigManager.KEY_INCLUDE_LTE_FOR_NR_ADVANCED_THRESHOLD_BANDWIDTH_BOOL,
                true);

        // LTE Cell with bandwidth = 10000
        CellIdentityLte cellIdentity10 =
                new CellIdentityLte(1, 1, 1, 1, new int[] {1, 2}, 10000, "1", "1", "test",
@@ -2403,6 +2402,9 @@ public class ServiceStateTrackerTest extends TelephonyTest {

    @Test
    public void testPhyChanBandwidthForNr() {
        mBundle.putBoolean(
                CarrierConfigManager.KEY_INCLUDE_LTE_FOR_NR_ADVANCED_THRESHOLD_BANDWIDTH_BOOL,
                false);
        // NR Cell with bandwidth = 10000
        CellIdentityNr nrCi = new CellIdentityNr(
                0, 0, 0, new int[]{10000}, "", "", 5, "", "", Collections.emptyList());