Fix the wrong comparison

Bug: 173387374
Test: atest NetworkSelectSettingsTest (PASS)
test on real device (PASS)

Change-Id: Ib1135b0457b4e35db67e671cad142657457d6d75
This commit is contained in:
SongFerngWang
2021-07-28 21:28:18 +08:00
committed by SongFerng Wang
parent 1a6982f195
commit 1bcba3d23f
2 changed files with 8 additions and 8 deletions

View File

@@ -327,10 +327,10 @@ public class NetworkSelectSettings extends DashboardFragment {
Class className = cellInfo.getClass(); Class className = cellInfo.getClass();
if (aggregatedList.stream().anyMatch( if (aggregatedList.stream().anyMatch(
i -> { item -> {
return (CellInfoUtil.getNetworkTitle(i.getCellIdentity(), String itemPlmn = CellInfoUtil.getNetworkTitle(item.getCellIdentity(),
CellInfoUtil.getCellIdentityMccMnc(i.getCellIdentity())) == plmn) CellInfoUtil.getCellIdentityMccMnc(item.getCellIdentity()));
&& i.getClass().equals(className); return itemPlmn.equals(plmn) && item.getClass().equals(className);
})) { })) {
continue; continue;
} }

View File

@@ -169,8 +169,8 @@ public class NetworkSelectSettingsTest {
private CellInfoLte createLteCellInfo(boolean registered, int cellId, String mcc, String mnc, private CellInfoLte createLteCellInfo(boolean registered, int cellId, String mcc, String mnc,
String plmnName) { String plmnName) {
CellIdentityLte cil = new CellIdentityLte( CellIdentityLte cil = new CellIdentityLte(
cellId, 5, 200, 2000, new int[]{1, 2}, 10000, mcc, cellId, 5, 200, 2000, new int[]{1, 2}, 10000, new String(mcc),
mnc, plmnName, plmnName, new String(mnc), new String(plmnName), new String(plmnName),
Collections.emptyList(), null); Collections.emptyList(), null);
CellSignalStrengthLte cssl = new CellSignalStrengthLte(15, 16, 17, 18, 19, 20); CellSignalStrengthLte cssl = new CellSignalStrengthLte(15, 16, 17, 18, 19, 20);
@@ -184,8 +184,8 @@ public class NetworkSelectSettingsTest {
private CellInfoGsm createGsmCellInfo(boolean registered, int cellId, String mcc, String mnc, private CellInfoGsm createGsmCellInfo(boolean registered, int cellId, String mcc, String mnc,
String plmnName) { String plmnName) {
CellIdentityGsm cig = new CellIdentityGsm(1, cellId, 40, 5, mcc, CellIdentityGsm cig = new CellIdentityGsm(1, cellId, 40, 5, new String(mcc),
mnc, plmnName, plmnName, new String(mnc), new String(plmnName), new String(plmnName),
Collections.emptyList()); Collections.emptyList());
CellSignalStrengthGsm cssg = new CellSignalStrengthGsm(5, 6, 7); CellSignalStrengthGsm cssg = new CellSignalStrengthGsm(5, 6, 7);
CellInfoGsm cellInfoGsm = new CellInfoGsm(); CellInfoGsm cellInfoGsm = new CellInfoGsm();