Android V 版本更新了创建APN相关的Data Profile代码逻辑,移除了createDataProfiles接口,新增了系列与APN相关的API实现,对APN进行过滤排序等列表数据操作,以及数据绑定的流程更新。
通过热插拔SIM卡加载APN的日志,对创建DataProfile流程加以说明。
功能流程
MTK U:
- onSubscriptionsChanged或onReceive广播ACTION_RADIO_TECHNOLOGY_CHANGED ->
- onSubIdReady ->
- updateDataProfiles ->
- createDataProfiles (会处理MNO和MVNO场景,更新全局变量profiles)
日志分析
Android V 一份插卡但无法驻网的log,此卡在其他手机是正常的,应该是band不支持联通。
DataProfile加载
热插拔,关闭APN界面
05-09 11:46:03.082 7518 7518 D ApnSettings: onSimHotSwap, finish activity.
05-09 11:46:03.083 1357 4446 I wm_finish_activity: [0,248227803,8,com.android.settings/.Settings$ApnSettingsActivity,app-request]
卡移除状态
05-09 11:46:03.147 5919 5957 I BugleRcsEngine: [55] byrb.P: (Sim): SIM state ABSENT
更新运营商名称显示
05-09 11:46:03.255 3304 3304 D CarrierTextController: updateCarrierText() - sim state is ready, displayText = No Service anySimReadyAndInService:false
05-09 11:46:04.158 3539 3539 I ImsResolver: Received Carrier Config Changed for SlotId: 0, SubId: -1, sim state: 1
原生逻辑或创建ims和emergency APN(空APN)给紧急场景
05-09 11:46:04.176 3539 3539 D DPM-0 : Found 2 data profiles. profiles = [[DataProfile=[ApnSetting] DEFAULT EIMS, 0, null, , null, null, null, null, null, 0, emergency, IPV4V6, IPV4V6, true, 0, false, 0, 0, 0, 0, 0, null, null, false, UNKNOWN, UNKNOWN, -1, -1, -1, false, 3, 961, false, UNEDITED, TrafficDescriptor={mDnn=, null}, preferred=false], [DataProfile=[ApnSetting] DEFAULT IMS, 0, null, ims, null, null, null, null, null, 0, ims, IPV4V6, IPV4V6, true, 0, false, 0, 0, 0, 0, 0, null, null, false, UNKNOWN, UNKNOWN, -1, -1, -1, false, 3, 961, false, UNEDITED, TrafficDescriptor={mDnn=ims, null}, preferred=false]]
在TelephonyProvider和DataNetworkController中,无卡场景下会无APN匹配并评估无一网络满足处理PDN请求
05-09 11:46:04.177 3539 3539 D TelephonyProvider: query URL_PREFERAPNSET_USING_SUBID, subIdString=-1, subId=-1
05-09 11:46:04.184 3539 3539 D DNC-0 : Re-evaluating 0 unsatisfied network requests in 0 groups, due to DATA_CONFIG_CHANGED
05-09 11:46:04.184 3539 3539 D DRM-0 : Remove all retry and throttling entries, reason=DATA_CONFIG_CHANGED
what?
05-09 11:46:11.712 3539 3539 D TelephonyProvider: insert, match=7, binderPid=3539, binderUid=1001
05-09 11:46:11.714 3539 3539 D TelephonyProvider: insert, rowId=content://telephony/siminfo/2, notify=false
05-09 11:46:11.715 3539 4003 D TelephonyProvider: update, match=13, binderPid=3539, binderUid=1001
卡加载完成但还不可用(为什么会有 [55][70]两个id?)
05-09 11:46:11.836 5919 5957 I BugleRcsEngine: [55] byrb.y: (Sim): SIM state LOADED
05-09 11:46:11.839 5919 5957 I BugleRcsEngine: [55] byrb.y: (Sim): State not valid, ignoring sim state loaded.
SIM可用并重新广播,但后面也一直是valid来着
05-09 11:46:11.889 3539 3539 D IntentBroadcaster: Broadcasting and adding intent for rebroadcast: android.intent.action.SIM_STATE_CHANGED READY for phoneId 0
SIM READY,更新运营商名称
05-09 11:46:11.952 3304 3304 D CarrierTextController: updateCarrierText() - sim state is ready, displayText = No Service anySimReadyAndInService:false
05-09 11:46:11.940 8860 8860 D SimChangedReceiver: onReceive action = android.intent.action.SIM_STATE_CHANGED
还没加载到运营商信息phone和RIL
05-09 11:46:12.481 3539 3539 D MtkDPM : DPM-0: mPlmnMvnoData = PlmnMvnoData(xxx) changed = true
05-09 11:46:12.481 3539 3539 D MtkDPM : DPM-0: onSubIdReady mPhoneType = 1 [1:GSM,2:CDMA]
05-09 11:46:12.481 3539 3539 D MtkDPM : DPM-0: mtkGetOperatorNumeric: phone type = 1 [1:GSM,2:CDMA], operator from phone = , operator from RIL =
05-09 11:46:12.481 3539 3539 D MtkDPM : DPM-0: onSubIdReady: empty operator numeric, return
subId ready但carrierconfig未加载完成
05-09 11:46:12.482 3539 3539 D MultiSimSettingController: onSubscriptionsChanged
05-09 11:46:12.482 3539 3539 D MultiSimSettingController: Carrier config subId 2 is not loaded.
DataProfileManager 匹配APN
05-09 11:46:12.484 3539 3539 D MtkDPM : DPM-0: EVENT_PLMN_DATA
05-09 11:46:12.484 3539 3539 D MtkDPM : DPM-0: mPlmnMvnoData = PlmnMvnoData(xxx) changed = true05-09 11:46:12.487 3539 3539 D MtkDPM : DPM-0: getMtuFromResource: mcc = 460, mnc = 1, mtu = 1400
05-09 11:46:12.488 3539 3539 D MtkDPM : DPM-0: mtkGetOperatorNumeric: phone type = 1 [1:GSM,2:CDMA], operator from phone = , operator from RIL = 46001
05-09 11:46:12.488 3539 3539 D MtkDPM : DPM-0: getApnListCursor: selection=numeric = '46001'
05-09 11:46:12.496 3539 3539 D MtkDPM : DPM-0: match MNO APN: 3
05-09 11:46:12.496 3539 3539 D DPM-0 : Added [DataProfile=[ApnSetting] 3gnet, 4650, 46001, 3gnet, , null, , null, null, 0, supl | hipri | default | xcap, IP, IPV4V6, true, 0, false, 0, 0, 0, 0, 0, null, , false, UNKNOWN, UNKNOWN, 0, -1, -1, false, 3, 961, false, UNEDITED, TrafficDescriptor={mDnn=3gnet, null}, preferred=false]
05-09 11:46:12.496 3539 3539 D DPM-0 : Added [DataProfile=[ApnSetting] 3gmms, 4651, 46001, 3gwap, , http://mmsc.myuni.com.cn, 10.0.0.172, 80, null, 0, mms, IPV4V6, IPV4V6, true, 0, false, 0, 0, 0, 0, 0, null, , false, UNKNOWN, UNKNOWN, 0, -1, -1, false, 3, 961, false, UNEDITED, TrafficDescriptor={mDnn=3gwap, null}, preferred=false]
05-09 11:46:12.497 3539 3539 D DPM-0 : Added [DataProfile=[ApnSetting] IMS, 4652, 46001, ims, , null, , null, null, 0, ims, IPV4V6, IPV4V6, true, 0, false, 0, 0, 0, 0, 0, null, , false, GPRS|EDGE|UMTS|CDMA|CDMA - EvDo rev. 0|CDMA - EvDo rev. A|CDMA - 1xRTT|HSDPA|HSUPA|HSPA|iDEN|CDMA - EvDo rev. B|LTE|CDMA - eHRPD|HSPA+|GSM|TD_SCDMA|IWLAN|LTE_CA|NR, UNKNOWN, 0, -1, -1, false, 3, 961, false, UNEDITED, TrafficDescriptor={mDnn=ims, null}, preferred=false]
05-09 11:46:12.497 3539 3539 D MtkDPM : DPM-0: Added default EIMS data profile.
下发 IA APN给MD
05-09 11:46:12.514 3539 3539 D DPM-0 : Initial attach data profile updated as [DataProfile=[ApnSetting] 3gnet, 4650, 46001, 3gnet, , null, , null, null, 0, su