业务知识
漫游有国内和国际漫游之分,Android代码定义如下:
//frameworks/base/telephony/java/android/telephony/ServiceState.java
/**
* registered in a domestic roaming network
* @hide
*/
@SystemApi
public static final int ROAMING_TYPE_DOMESTIC = 2;
/**
* registered in an international roaming network
* @hide
*/
@SystemApi
public static final int ROAMING_TYPE_INTERNATIONAL = 3;
ROAMING_TYPE_XXX | int | Function |
---|---|---|
ROAMING_TYPE_DOMESTIC | 2 | 国内漫游 domestic |
ROAMING_TYPE_INTERNATIONAL | 3 | 国际漫游 international |
参考:【笔记】Android 漫游定制SPN定制有关字段-CSDN博客
不清楚漫游到国内外的情况时,可以通过底层上报获取状态,接口getDataRoamingType()。
日志分析
- < DATA_REGISTRATION_STATE :MD上报注册状态信息
- Poll ServiceState done :上层Telephony SST更新
- DataRoamingType:包含在SS网络信息
- setCarrierText:更新运营商名称
- Broadcasting ServiceState:SST广播网络状态更新
//处于搜网
04-12 13:38:30.662296 2098 2545 D RILJ : [0936]< DATA_REGISTRATION_STATE android.hardware.radio.network.RegStateResult{regState: NOT_REG_MT_NOT_SEARCHING_OP, rat: UNKNOWN, reasonForDenial: NONE, cellIdentity: android.hardware.radio.network.CellIdentity.noinit(false), registeredPlmn: , accessTechnologySpecificInfo: android.hardware.radio.network.AccessTechnologySpecificInfo.noinit(false)} [PHONE0]
//ServiceState状态是漫游中,但状态未知
04-12 13:38:42.310670 2098 2098 D MTKSST : [GsmSST0] handlePollStateResultMessage: PS cellular. NetworkRegistrationInfo{ domain=PS transportType=WWAN registrationState=ROAMING networkRegistrationState=ROAMING roamingType=UNKNOWN accessNetworkTechnology=LTE rejectCause=0 emergencyEnabled=false availableServices&