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

Commit f07e16a2 authored by Pengquan Meng's avatar Pengquan Meng Committed by Android (Google) Code Review
Browse files

Merge "Add brandOverride back to IccRecord" into qt-qpr1-dev

parents 319c12bb cabbc51f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -83,8 +83,8 @@ public class ApnSettingUtils {
     */
    public static boolean mvnoMatches(IccRecords r, int mvnoType, String mvnoMatchData) {
        if (mvnoType == ApnSetting.MVNO_TYPE_SPN) {
            if ((r.getServiceProviderName() != null)
                    && r.getServiceProviderName().equalsIgnoreCase(mvnoMatchData)) {
            String spn = r.getServiceProviderNameWithBrandOverride();
            if ((spn != null) && spn.equalsIgnoreCase(mvnoMatchData)) {
                return true;
            }
        } else if (mvnoType == ApnSetting.MVNO_TYPE_IMSI) {
+18 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.internal.telephony.uicc;

import android.annotation.IntDef;
import android.annotation.Nullable;
import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.os.AsyncResult;
@@ -694,6 +695,23 @@ public abstract class IccRecords extends Handler implements IccConstants {
        return mSpn;
    }

    /**
     * Return Service Provider Name stored in SIM (EF_SPN=0x6F46) or in RUIM (EF_RUIM_SPN=0x6F41) or
     * the brand override. The brand override has higher priority than the SPN from SIM.
     *
     * @return service provider name.
     */
    @Nullable
    public String getServiceProviderNameWithBrandOverride() {
        if (mParentApp != null && mParentApp.getUiccProfile() != null) {
            String brandOverride = mParentApp.getUiccProfile().getOperatorBrandOverride();
            if (!TextUtils.isEmpty(brandOverride)) {
                return brandOverride;
            }
        }
        return mSpn;
    }

    protected void setServiceProviderName(String spn) {
        if (!TextUtils.equals(mSpn, spn)) {
            mSpn = spn != null ? spn.trim() : null;