需要修改的地方:
1 SubscriptionController :addSubInfoRecord
2 SubscriptionInfoUpdater:updateSubName 应对Intent.ACTION_LOCALE_CHANGED
3 SubscriptionInfoUpdater:handleSimLoaded
4 ServiceStateTracker 中用于更新operator运营商名字
5 SIMRecords:setDisplayName (会覆盖之前的设定)
差异:
1 Qcom 没有定义 static String PROPERTY_ICC_OPERATOR_DEFAULT_NAME = "gsm.sim.operator.default-name";
在SIMRecords:onAllRecordsLoaded中无需设定该property
2 MTK 平台中RIL 层支持lookupOperatorNameFromNetwork(ServiceStateTracker中用到),顾名思义从网络获取运营商名字,这样会更精准,Qcom没有支持
修改的文件:
project LA.UM.6.2/LINUX/android/frameworks/opt/telephony/
-m src/java/com/android/internal/telephony/ServiceStateTracker.java
-m src/java/com/android/internal/telephony/SubscriptionController.java
-m src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java
-m src/java/com/android/internal/telephony/uicc/SIMRecords.java
-m src/java/com/android/internal/telephony/uicc/SpnOverride.java
所有运营商:
<string name="oper_long_46000">中国移动</string>
<string name="oper_long_46001">中国联通</string>
<string name="oper_long_46003">中国电信</string>
<string name="oper_long_46601">远传电信</string>
<string name="oper_long_46692">中华电信</string>
<string name="oper_long_46697">台湾大哥大</string>
<string name="oper_long_46605">GT4G</string>
<string name="oper_long_46689">台湾之星</string>
<string name="oper_long_45500">数码通</string>
<string name="oper_long_45501">澳门电讯</string>
<string name="oper_long_45503">和记电讯</string>
<string name="oper_long_45416">电讯盈科</string>
SpnOverride.java
public String lookupOperatorName(int subId, String numeric,
boolean desireLongName, Context context) {
String operName = null;
Phone phone = PhoneFactory.getPhone(SubscriptionManager.getPhoneId(subId));
if (phone == null) {
Rlog.w(LOG_TAG, "lookupOperatorName getPhone null");
return operName;
}
switch (numeric) {
case "46000":
case "46002":
case "46004":
case "46007":
case "46008":
operName = context.getText(com.meitu.internal.R.string.oper_long_46000).toString();
break;
case "46001":
case "46009":
case "45407":
operName = context.getText(com.meitu.internal.R.string.oper_long_46001).toString();
break;
case "46003":
case "46011":
operName = context.getText(com.meitu.internal.R.string.oper_long_46003).toString();
break;
case "46601":
operName = context.getText(com.meitu.internal.R.string.oper_long_46601).toString();
break;
case "46692":
operName = context.getText(com.meitu.internal.R.string.oper_long_46692).toString();
break;
case "46697":
operName = context.getText(com.meitu.internal.R.string.oper_long_46697).toString();
break;
case "46605":
operName = context.getText(com.meitu.internal.R.string.oper_long_46605).toString();
break;
case "46689":
operName = context.getText(com.meitu.internal.R.string.oper_long_46689).toString();
break;
case "99998":
operName = context.getText(com.meitu.internal.R.string.oper_long_99998).toString();
break;
case "99999":
operName = context.getText(com.meitu.internal.R.string.oper_long_99999).toString();
break;
case "45500":
case "45406":
operName = context.getText(com.meitu.internal.R.string.oper_long_45500).toString();
break;
case "45503":
case "45404":
operName = context.getText(com.meitu.internal.R.string.oper_long_45503).toString();
break;
case "45501":
operName = context.getText(com.meitu.internal.R.string.oper_long_45501).toString();
break;
case "45419":
case "45416":
operName = context.getText(com.meitu.internal.R.string.oper_long_45416).toString();
break;
default:
if (containsCarrier(numeric)) {
operName = getSpn(numeric);
} else {
Rlog.d(LOG_TAG, "Can't find long operator name for " + numeric);
}
break;
}
}
为了统一状态栏的显示,后面也将PLMN的名字进行了转换。
PLMN可以理解为运营商名字,是真正注册上的网络的名字, SPN是Sim卡真正所属的运营商的名字。
比如:
中国移动注册中国移动的网络,那么PLMN=SPN=中国移动
中国移动注册中国联通的网络,那么PLMN=中国联通; SPN=中国移动
具体显示详情还要根据Sim卡的配置来决定。
TelephonManager中的getNetworkOperator获取的就是网络mcc+mnc,对应PLMN
getSimOperator获取的就是Sim卡运营商的mcc+mnc, 对应SPN
网友评论