Merge "Match APN types with ignoring the case" into main

This commit is contained in:
Treehugger Robot
2023-07-26 04:03:19 +00:00
committed by Gerrit Code Review

View File

@@ -429,15 +429,20 @@ public class ApnEditor extends SettingsPreferenceFragment
return false; return false;
} }
if (hasAllApns(apnTypesArray1) || TextUtils.isEmpty(apnTypes2)) { final String[] apnTypesArray1LowerCase = new String[apnTypesArray1.length];
for (int i = 0; i < apnTypesArray1.length; i++) {
apnTypesArray1LowerCase[i] = apnTypesArray1[i].toLowerCase();
}
if (hasAllApns(apnTypesArray1LowerCase) || TextUtils.isEmpty(apnTypes2)) {
return true; return true;
} }
final List apnTypesList1 = Arrays.asList(apnTypesArray1); final List apnTypesList1 = Arrays.asList(apnTypesArray1LowerCase);
final String[] apnTypesArray2 = apnTypes2.split(","); final String[] apnTypesArray2 = apnTypes2.split(",");
for (String apn : apnTypesArray2) { for (String apn : apnTypesArray2) {
if (apnTypesList1.contains(apn.trim())) { if (apnTypesList1.contains(apn.trim().toLowerCase())) {
Log.d(TAG, "apnTypesMatch: true because match found for " + apn.trim()); Log.d(TAG, "apnTypesMatch: true because match found for " + apn.trim());
return true; return true;
} }