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

Commit 12078030 authored by Nathan Harold's avatar Nathan Harold
Browse files

Null Check MCC and MNC for CellIdentity Location

In CDMA the MCC and MNC can be null, and the existing
checks for invalid PLMN didn't actually check for
invalid PLMN. Add a simple set of null checks as the
smallest possible change.

Bug: 141416587
Test: manual with CDMA
Merged-In: Ib34fa65fefd7fc17ee77e698b1269f8c40ce5688
Change-Id: Ib34fa65fefd7fc17ee77e698b1269f8c40ce5688
(cherry picked from commit 44369497)
parent e794e428
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -3307,10 +3307,13 @@ public class ServiceStateTracker extends Handler {
            // camped on a cell either to attempt registration or for emergency services, then
            // for purposes of setting the locale, we don't care if registration fails or is
            // incomplete.
            String localeOperator = isInvalidOperatorNumeric(operatorNumeric)
                    && (mCellIdentity != null)
                    ? mCellIdentity.getMccString() + mCellIdentity.getMncString()
                    : operatorNumeric;
            // CellIdentity can return a null MCC and MNC in CDMA
            String localeOperator = operatorNumeric;
            if (isInvalidOperatorNumeric(operatorNumeric) && (mCellIdentity != null)
                    && mCellIdentity.getMccString() != null
                    && mCellIdentity.getMncString() != null) {
                localeOperator = mCellIdentity.getMccString() + mCellIdentity.getMncString();
            }

            if (isInvalidOperatorNumeric(localeOperator)) {
                if (DBG) log("localeOperator " + localeOperator + " is invalid");