diff options
author | Sarah Kim <sarahchin@google.com> | 2023-06-21 21:58:50 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2023-06-21 21:58:50 +0000 |
commit | fde282c9dca22c2d9bb9ec60002a5ac991a53fed (patch) | |
tree | 9545b45aea6afccc878e7ef8df88ff7e30ed52b2 | |
parent | 53d1bd0f504d47c74bc547d6a4beebd52088cfd5 (diff) | |
download | telephony-fde282c9dca22c2d9bb9ec60002a5ac991a53fed.tar.gz |
Revert "ServiceStateTracker consider config for combined bandwidth"
This reverts commit 53d1bd0f504d47c74bc547d6a4beebd52088cfd5.
Reason for revert: b/286594668
Change-Id: I12e1a8e04d3ee4d58cdd24a5fe03bc0de6f4de78
-rw-r--r-- | src/java/com/android/internal/telephony/ServiceStateTracker.java | 24 | ||||
-rw-r--r-- | tests/telephonytests/src/com/android/internal/telephony/ServiceStateTrackerTest.java | 10 |
2 files changed, 17 insertions, 17 deletions
diff --git a/src/java/com/android/internal/telephony/ServiceStateTracker.java b/src/java/com/android/internal/telephony/ServiceStateTracker.java index 29b1acae28..9fb7d439eb 100644 --- a/src/java/com/android/internal/telephony/ServiceStateTracker.java +++ b/src/java/com/android/internal/telephony/ServiceStateTracker.java @@ -1695,9 +1695,16 @@ 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 = getBandwidthsFromLastPhysicalChannelConfigs(); + bandwidths = list.stream() + .filter(config -> includeLte || config.getNetworkType() + == TelephonyManager.NETWORK_TYPE_NR) + .map(PhysicalChannelConfig::getCellBandwidthDownlinkKhz) + .mapToInt(Integer::intValue) + .toArray(); } if (anchorNrCellId == mLastAnchorNrCellId && anchorNrCellId != PhysicalChannelConfig.PHYSICAL_CELL_ID_UNKNOWN) { @@ -1705,8 +1712,7 @@ public class ServiceStateTracker extends Handler { hasChanged |= RatRatcheter.updateBandwidths(bandwidths, mSS); } else { log("Do not ratchet bandwidths since anchor NR cell is different (" - + mLastAnchorNrCellId + " -> " + anchorNrCellId - + "). New bandwidths are " + Arrays.toString(bandwidths)); + + mLastAnchorNrCellId + "->" + anchorNrCellId + ")."); mLastAnchorNrCellId = anchorNrCellId; hasChanged |= !Arrays.equals(mSS.getCellBandwidths(), bandwidths); mSS.setCellBandwidths(bandwidths); @@ -1790,12 +1796,8 @@ public class ServiceStateTracker extends Handler { return simAbsent; } - 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) + private static int[] getBandwidthsFromConfigs(List<PhysicalChannelConfig> list) { + return list.stream() .map(PhysicalChannelConfig::getCellBandwidthDownlinkKhz) .mapToInt(Integer::intValue) .toArray(); @@ -2555,7 +2557,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 = getBandwidthsFromLastPhysicalChannelConfigs(); + bandwidths = getBandwidthsFromConfigs(mLastPhysicalChannelConfigList); for (int bw : bandwidths) { if (!isValidLteBandwidthKhz(bw)) { loge("Invalid LTE Bandwidth in RegistrationState, " + bw); @@ -2591,7 +2593,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 = getBandwidthsFromLastPhysicalChannelConfigs(); + bandwidths = getBandwidthsFromConfigs(mLastPhysicalChannelConfigList); for (int bw : bandwidths) { if (!isValidNrBandwidthKhz(bw)) { loge("Invalid NR Bandwidth in RegistrationState, " + bw); diff --git a/tests/telephonytests/src/com/android/internal/telephony/ServiceStateTrackerTest.java b/tests/telephonytests/src/com/android/internal/telephony/ServiceStateTrackerTest.java index 379117cad0..280fbcc177 100644 --- a/tests/telephonytests/src/com/android/internal/telephony/ServiceStateTrackerTest.java +++ b/tests/telephonytests/src/com/android/internal/telephony/ServiceStateTrackerTest.java @@ -374,9 +374,6 @@ 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()); @@ -2285,6 +2282,10 @@ 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", @@ -2369,9 +2370,6 @@ 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()); |