业务简介
在网络状态变化的时候(数据或WiFi),会更新SPN。
基于Android U的代码分析。
分类:SPN Data_Dic-的博客-CSDN博客
功能逻辑
状态说明
- 飞行模式下注册上WFC的话,注册状态MD上报
- regState: NOT_REG_MT_NOT_SEARCHING_OP, rat: UNKNOWN
- DataReg一直都是PowerOff或者out of service状态,此时不会更新spn
- [GsmSST0] Broadcasting ServiceState : {mVoiceRegState=3(POWER_OFF), mDataRegState=3(POWER_OFF),
- updateSpnDisplay: radio is off w/ showPlmn=true plmn=null
更新网络状态 ServiceStateTracker.java
frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
MTKSST实现中handlePollStateResult()和pollStateDone()都会refreshSpn()刷新SPN,区别于源码的 updateSpnDisplay(),并且在上述两个state接口执行时就刷新,时间比 updateSpnDisplay 还早。
代码流程:
- handlePollStateResult
- pollStateInternal()
- pollStateDone()
- updateSpnDisplay()--radio off不会更新
日志分析
03-04 18:31:51.632486 3799 3799 D MTKSST : [GsmSST0] Broadcasting ServiceState : {mVoiceRegState=0(IN_SERVICE), mDataRegState=0(IN_SERVICE), mChannelNumber=2959, duplexMode()=0, mCellBandwidths=[], mOperatorAlphaLong=Orange SP, mOperatorAlphaShort=Orange SP, isManualNetworkSelection=false(automatic), getRilVoiceRadioTechnology=3(UMTS), getRilDataRadioTechnology=11(HSPA), mCssIndicator=unsupported, mNetworkId=-1, mSystemId=-1, mCdmaRoamingIndicator=-1, mCdmaDefaultRoamingIndicator=-1, mIsEmergencyOnly=false, isUsingCarrierAggregation=false, mArfcnRsrpBoost=0, mNetworkRegistrationInfos=[NetworkRegistrationInfo{ domain=PS transportType=WLAN registrationState=NOT_REG_OR_SEARCHING networkRegistrationState=NOT_REG_OR_SEARCHING roamingType=NOT_ROAMING accessNetworkTechnology=UNKNOWN rejectCause=0 emergencyEnabled=false availableServices=[] cellIdentity=null voiceSpecificInfo=null dataSpecificInfo=android.telephony.DataSpecificRegistrationInfo :{ maxDataCalls = 0 isDcNrRestricted = false isNrAvailable = false isEnDcAvailable = false mLteAttachResultType = 0 mLteAttachExtraInfo = 0 LteVopsSupportInfo : mVopsSupport = 1 mEmcBearerSupport = 1 } nrState=**** rRplmn=null isUsingCarrierAggregation=false}, NetworkRegistrationInfo{ domain=CS transportType=WWAN registrationState=HOME networkRegistrationState=ROAMING roamingType=NOT_ROAMING accessNetworkTechnology=UMTS rejectCause=0 emergencyEnabled=false availableServices=[VOICE,SMS,VIDEO] cellIdentity=CellIdentityWcdma:{ mLac=1134 mCid=149649449 mPsc=358 mUarfcn=2959 mMcc=214 mMnc=03 mAlphaLong=Orange SP mAlphaShort=Orange SP mAdditionalPlmns={} mCsgInfo=null} voiceSpecificInfo=VoiceSpecificRegistrationInfo { mCssSupported=false mRoamingIndicator=0 mSystemIsInPrl=0 mDefaultRoamingIndicator=0} dataSpecificInfo=null nrState=**** rRplmn=21403 isUsingCarrierAggregation=false}, NetworkRegistrationInfo{ domain=PS transportType=WWAN registrationState=HOME networkRegistrationState=ROAMING roamingType=NOT_ROAMING accessNetworkTechnology=HSPA rejectCause=0 emergencyEnabled=false availableServices=[DATA] cellIdentity=CellIdentityWcdma:{ mLac=1134 mCid=149649449 mPsc=358 mUarfcn=2959 mMcc=214 mMnc=03 mAlphaLong=Orange SP mAlphaShort=Orange SP mAdditionalPlmns={} mCsgInfo=null} voiceSpecificInfo=null dataSpecificInfo=android.telephony.DataSpecificRegistrationInfo :{ maxDataCalls = 16 isDcNrRestricted = false isNrAvailable = false isEnDcAvailable = false mLteAttachResultType = 0 mLteAttachExtraInfo = 0 null } nrState=**** rRplmn=21403 isUsingCarrierAggregation=false}], mNrFrequencyRange=0, mOperatorAlphaLongRaw=Orange, mOperatorAlphaShortRaw=Orange, mIsDataRoamingFromRegistration=true, mIsIwlanPreferred=false}
分段分析:
如上三个NetworkRegistrationInfo,包含WLAN和WWAN两种transportType。
关注Emergency Call业务,需要Voice能力,故选取中间的状态进行分析。
- registrationState 的值为 HOME ,表示该设备已成功注册到本地运营商的网络,即该设备正在其所属的运营商的服务区域内。
- networkRegistrationState 的值为 ROAMING ,表示该设备正在漫游,但是由于accessNetworkTechnology 的值为 UMTS ,即设备使用的是 3G 网络,因此这种情况下也可以视为没有漫游。
- roamingType 值为NOT_ROAMING,说明非漫游。
日志:
NetworkRegistrationInfo{ domain=CS transportType=WWAN registrationState=HOME networkRegistrationState=ROAMING roamingType=NOT_ROAMING accessNetworkTechnology=UMTS rejectCause=0 emergencyEnabled=false availableServices=[VOICE,SMS,VIDEO] cellIdentity=CellIdentityWcdma:{ mLac=1134 mCid=149649449 mPsc=358 mUarfcn=2959 mMcc=214 mMnc=03 mAlphaLong=Orange SP mAlphaShort=Orange SP mAdditionalPlmns={} mCsgInfo=null} voiceSpecificInfo=VoiceSpecificRegistrationInfo { mCssSupported=false mRoamingIndicator=0 mSystemIsInPrl=0 mDefaultRoamingIndicator=0} dataSpecificInfo=null nrState=**** rRplmn=21403 isUsingCarrierAggregation=false},
专业名词:
- RPLMN(Registered Public Land Mobile Network)是指设备所连接的当前注册公共陆地移动网络。
- UMTS 是一种全球标准的第三代移动通信技术,可以在全球范围内实现漫游。