规则简介
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;
}
}