功能背景说明
分析日志中关于AT “< OPERATOR” 的运营商名称信息来源。
04-22 22:53:25.915403 2140 2140 D RILJ : [0209]> OPERATOR [PHONE0]
04-22 22:53:25.922854 2140 2157 D RILJ : [0209]< OPERATOR {telering, telering, 23207} [PHONE0]
与MD交互,RILJ和RIJD(RIL_REQUEST_OPERATOR)
根据ril.h的注释说明,该信息是EONS的(Enhanced Operator Name String),即EF文件信息。
EONS信息来源:
- EF_PNN(PLMN Network Name, fid: 6FC5) :LAC和EF_PNN中的Record Identifier
- EF_OPL(Operator PLMN List, fid: 6FC6) :Network Name,具体名称
Code in SIMRecords.java getEonsIfExist()
因此< OPERATOR {long Alpha, short Alpha, MCCMNC}
代码
RILUtils.java
frameworks/opt/telephony/src/java/com/android/internal/telephony/RILUtils.java
import static com.android.internal.telephony.RILConstants.RIL_REQUEST_OPERATOR;
import java.lang.reflect.Method;
/**
* Utils class for HAL <-> RIL conversions
*/
public class RILUtils {
private static final String TAG = "RILUtils";
/**
* RIL request to String
* @param request request
* @return The converted String request
*/
public static String requestToString(int request) {
switch(request) {
case RIL_REQUEST_OPERATOR:
return "OPERATOR";
}
ril.h
hardware/ril/include/telephony/ril.h
定义说明当前使用v12
/*
* RIL version.
* Value of RIL_VERSION should not be changed in future. Here onwards,
* when a new change is supposed to be introduced which could involve new
* schemes added like Wakelocks, data structures added/updated, etc, we would
* just document RIL version associated with that change below. When OEM updates its
* RIL with those changes, they would return that new RIL version during RIL_REGISTER.
* We should make use of the returned version by vendor to identify appropriate scheme
* or data structure version to use.
*
* Documentation of RIL version and associated changes
* RIL_VERSION = 12 : This version corresponds to updated data structures namely
* RIL_Data_Call_Response_v11, RIL_SIM_IO_v6, RIL_CardStatus_v6,
* RIL_SimRefreshResponse_v7, RIL_CDMA_CallWaiting_v6,
* RIL_LTE_SignalStrength_v8, RIL_SignalStrength_v10, RIL_CellIdentityGsm_v12
* RIL_CellIdentityWcdma_v12, RIL_CellIdentityLte_v12,RIL_CellInfoGsm_v12,
* RIL_CellInfoWcdma_v12, RIL_CellInfoLte_v12, RIL_CellInfo_v12.
*
* RIL_VERSION = 13 : This version includes new wakelock semantics and as the first
* strongly versioned version it enforces structure use.
*
* RIL_VERSION = 14 : New data structures are added, namely RIL_CarrierMatchType,
* RIL_Carrier, RIL_CarrierRestrictions and RIL_PCO_Data.
* New commands added: RIL_REQUEST_SET_CARRIER_RESTRICTIONS,
* RIL_REQUEST_SET_CARRIER_RESTRICTIONS and RIL_UNSOL_PCO_DATA.
*
* RIL_VERSION = 15 : New commands added:
* RIL_UNSOL_MODEM_RESTART,
* RIL_REQUEST_SEND_DEVICE_STATE,
* RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER,
* RIL_REQUEST_SET_SIM_CARD_POWER,
* RIL_REQUEST_SET_CARRIER_INFO_IMSI_ENCRYPTION,
* RIL_UNSOL_CARRIER_INFO_IMSI_ENCRYPTION
* The new parameters for RIL_REQUEST_SETUP_DATA_CALL,
* Updated data structures: RIL_DataProfileInfo_v15, RIL_InitialAttachApn_v15
* New data structure RIL_DataRegistrationStateResponse,
* RIL_VoiceRegistrationStateResponse same is
* used in RIL_REQUEST_DATA_REGISTRATION_STATE and
* RIL_REQUEST_VOICE_REGISTRATION_STATE respectively.
* New data structure RIL_OpenChannelParams.
* RIL_REQUEST_START_NETWORK_SCAN
* RIL_REQUEST_STOP_NETWORK_SCAN
* RIL_UNSOL_NETWORK_SCAN_RESULT
*/
#define RIL_VERSION 12
说明了 “< OPERATOR” 返回的参数是{long,short,mccmnc}
/**
* RIL_REQUEST_OPERATOR
*
* Request current operator ONS or EONS
*
* "data" is NULL
* "response" is a "const char **"
* ((const char **)response)[0] is long alpha ONS or EONS
* or NULL if unregistered
*
* ((const char **)response)[1] is short alpha ONS or EONS
* or NULL if unregistered
* ((const char **)response)[2] is 5 or 6 digit numeric code (MCC + MNC)
* or NULL if unregistered
*
* Valid errors:
* SUCCESS
* RADIO_NOT_AVAILABLE
* NO_MEMORY
* INTERNAL_ERR
* SYSTEM_ERR
* REQUEST_NOT_SUPPORTED
* NO_RESOURCES
* CANCELLED
*/
#define RIL_REQUEST_OPERATOR 22
hardware/ril/libril/ril_commands.h
命令定义?
{RIL_REQUEST_OPERATOR, radio::getOperatorResponse},
Need to improve