SPN-PLMN运营商名称更新的一些规则及代码逻辑

规则简介

EONS也是更新PLMN,而不是SPN,SPN都是依据卡信息。

在MTK平台上,提供lookupOperatorName逻辑,根据SPN/EONS/NITZ刷新运营商名称显示内容,也可以自定义优先级。

流程接口

  • [SST] refreshSPN 更新SPN =>
    • Note:MTK源码是通过lookupOperatorName,客制化加入config使之执行下述lookupOperatorNameWithConfig,区别只是多加了形参ruleConfig。
  • [SST] getConfig 获取配置,确认是否有定制优先级 ——这与display rule没关系 =>
  • [RILJ] lookupOperatorNameWithConfig =>
    • 可以自定义来源优先级,比如SA设备用5GEons: lookupOperator5GName 
    • [RILJ]  lookupOperatorNameEons
      • [SIMRecords] getEonsIfExist() 获取卡EF信息 
    • [RILJ]  lookupOperatorNameNitz
    • [RILJ]  lookupOperatorNameMVNO 获取TS25的配置,一般是上层spn-conf.xml文件,在MTK 6835平台由MD维护
  • [SIMRecords]

功能代码

ServiceStateTracker.java 刷新SPN(refreshSpn)

vendor/mediatek/proprietary/frameworks/opt/telephony/src/java/com/mediatek/internal/telephony/MtkServiceStateTracker.java

    /* Refresh operator name after mcc, mnc and lac are available
     * so we can get EONS correctly
     * If caller is not from pollState, we can not set the new PLMN to ss.
     * It leads wrong state during the next pollState.
     * If PLMN changes, the caller should restart the pollState.
     */
    protected boolean refreshSpn(ServiceState ss, boolean fromPollState) {
       
        boolean needPollState = false;    //根据注册信息更新运营商名称
        String strOperatorLong = "";
        String strOperatorShort = "";
        if (brandOverride != null) {
            log("refreshSpn: use brandOverride" + brandOverride);
            strOperatorLong = brandOverride;
            strOperatorShort = brandOverride;
        } else {
            int lac = getLacFromServiceState(ss);    //获取位置区域码 Location Area Code
            int configRule = getConfigRule();    //客制化配置优先级

            //MTK默认逻辑lookupOperatorName
            /*
            strOperatorLong = ((MtkRIL)mCi).lookupOperatorName(
                    mPhone.getSubId(),
                    ss.getOperatorNumeric(), true, lac, ss);
            strOperatorShort = ((MtkRIL)mCi).lookupOperatorName(
                    mPhone.getSubId(),
                    ss.getOperatorNumeric(), false, lac, ss);
            */

            //客制化加入配置
            strOperatorLong = ((MtkRIL)mCi).lookupOperatorNameWithConfig(
                mPhone.getSubId(),
                ss.getOperatorNumeric(), true, lac,
                (MtkRIL.DISPLAY_TS25 | MtkRIL.DISPLAY_EONS | MtkRIL.DISPLAY_NITZ), ss, configRule);
            strOperatorShort = ((MtkRIL)mCi).lookupOperatorNameWithConfig(
                mPhone.getSubId(),
                ss.getOperatorNumeric(), false, lac,
                (MtkRIL.DISPLAY_TS25 | MtkRIL.DISPLAY_EONS | MtkRIL.DISPLAY_NITZ), ss, configRule);
        }
        // If the PLMN is different with the ss.
        if ((!TextUtils.equals(strOperatorLong, ss.getOperatorAlphaLong())) ||
            (!TextUtils.equals(strOperatorShort, ss.getOperatorAlphaShort()))) {
            needPollState = true;
            // PLMN changes and we only update it if we are doing pollState
            // Other source should start pollState if needPollState is true.
            if (fromPollState) {
                updateSsOperatorName(ss, strOperatorLong, strOperatorShort, ss.getOperatorNumeric());
            }
        }
        log("refreshSpn: " + strOperatorLong
                + ", " + strOperatorShort
                + ", fromPollState=" + fromPollState
                + ", needPollState=" + needPollState);
        return needPollState;
    }

}


RIL.java 读取数据源(lookupOperatorName)

  • 20
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值