Lost the registered cellinfo item after the aggregation

Bug: 204384218
Test: atest NetworkSelectSettingsTest
Change-Id: I163ab8e966de57ddff7939a46fc47b05bea029e3
This commit is contained in:
SongFerngWang
2021-11-15 22:32:22 +08:00
parent e87862a245
commit f0575366c4
2 changed files with 24 additions and 2 deletions

View File

@@ -266,6 +266,20 @@ public class NetworkSelectSettingsTest {
assertThat(mNetworkSelectSettings.doAggregation(testList)).isEqualTo(expected);
}
@Test
public void doAggregation_hasDuplicateItemsDiffMccMncCase3_removeSamePlmnRatItem() {
mNetworkSelectSettings.onCreateInitialization();
List<CellInfo> testList = Arrays.asList(
createLteCellInfo(false, 123, "123", "232", "CarrierA"),
createLteCellInfo(false, 124, "123", "233", "CarrierA"),
createLteCellInfo(true, 125, "123", "234", "CarrierA"),
createGsmCellInfo(false, 126, "456", "232", "CarrierA"));
List<CellInfo> expected = Arrays.asList(
createLteCellInfo(true, 125, "123", "234", "CarrierA"),
createGsmCellInfo(false, 126, "456", "232", "CarrierA"));
assertThat(mNetworkSelectSettings.doAggregation(testList)).isEqualTo(expected);
}
private CellInfoLte createLteCellInfo(boolean registered, int cellId, String mcc, String mnc,
String plmnName) {
CellIdentityLte cil = new CellIdentityLte(