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

Commit 2bc7f2e1 authored by Anju Mathapati's avatar Anju Mathapati Committed by Robert Greenwalt
Browse files

Use proper check for spn for operator name display

Change null check to null or empty string check.

bug:7389730
Change-Id: I593429b8668b49978ad38b28062b8b2031464813
parent 44be3fc4
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.os.AsyncResult;
import android.os.Handler;
import android.os.Message;
import android.os.SystemProperties;
import android.text.TextUtils;
import android.util.Log;

import com.android.internal.telephony.AdnRecord;
@@ -1407,13 +1408,14 @@ public class SIMRecords extends IccRecords {
     * specified plmn (currently-registered PLMN).  See TS 22.101 Annex A
     * and TS 51.011 10.3.11 for details.
     *
     * If the SPN is not found on the SIM, the rule is always PLMN_ONLY.
     * If the SPN is not found on the SIM or is empty, the rule is
     * always PLMN_ONLY.
     */
    @Override
    public int getDisplayRule(String plmn) {
        int rule;
        if (spn == null || spnDisplayCondition == -1) {
            // EF_SPN was not found on the SIM, or not yet loaded.  Just show ONS.
        if (TextUtils.isEmpty(spn) || spnDisplayCondition == -1) {
            // No EF_SPN content was found on the SIM, or not yet loaded.  Just show ONS.
            rule = SPN_RULE_SHOW_PLMN;
        } else if (isOnMatchingPlmn(plmn)) {
            rule = SPN_RULE_SHOW_SPN;