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

Commit f19c513d authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add null check for mcc value"

parents bc8e0b1a 2e70516b
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -315,7 +315,7 @@ public class LocaleTracker extends Handler {
     * @return a matching {@link MccMnc}. Null if the information is not available.
     */
    @Nullable
    private MccMnc getMccMncFromCellInfo(String mccToMatch) {
    private MccMnc getMccMncFromCellInfo(@NonNull String mccToMatch) {
        MccMnc selectedMccMnc = null;
        if (mCellInfoList != null) {
            Map<MccMnc, Integer> mccMncMap = new HashMap<>();
@@ -342,6 +342,7 @@ public class LocaleTracker extends Handler {
        return selectedMccMnc;
    }

    @Nullable
    private static String getNetworkMcc(CellInfo cellInfo) {
        String mccString = null;
        if (cellInfo instanceof CellInfoGsm) {
@@ -536,6 +537,7 @@ public class LocaleTracker extends Handler {
        // info.
        if (TextUtils.isEmpty(countryIso)) {
            String mcc = getMccFromCellInfo();
            if (mcc != null) {
                countryIso = MccTable.countryCodeForMcc(mcc);
                countryIsoDebugInfo = "CellInfo: MccTable.countryCodeForMcc(\"" + mcc + "\")";

@@ -546,6 +548,7 @@ public class LocaleTracker extends Handler {
                            "CellInfo: MccTable.geoCountryCodeForMccMnc(" + mccMnc + ")";
                }
            }
        }

        if (mCountryOverride != null) {
            countryIso = mCountryOverride;