KaiOS OTA APN 方案

需求和实现逻辑

OMADM 机制根据节点信息修改对应的APN,因此代码也通过Node消息管控实现。

  1. _listenOpApnSettings
  2. opCheckIsInProgressAndSaveNodeValue
  3. saveAndUpdateApnValue
    1. this.operatorVariantHandlers[simslot.index].applySettings(mcc, mnc/*, false*/, apnEnabledStateChange)
  4. applySettings(mcc, mnc, updateAPN)
  5. applyOperatorVariantSettings(result)
  6. buildApnSettings(allApnList)
    1. 初始化APN数组 var apnSettings = [] 和tmpApnSettings
    2. 根据APN_TYPES.length长度遍历赋值tmpApnSettings,
    3. 再将数组拷贝给apnSettings 保存 apnSettings = this.convertApnSettings(tmpApnSettings); this.buildPreferredApnSettings(apnSettings);
  7. buildPreferredApnSettings(apnSettings) 
  8. navigator.b2g.engmodeManager.setDataProfileByType(JSON.stringify(apnSettings[index]), 1);

接口表

Interface Module Comment
_listenOpApnSettings(simslot)  operator_variant_manager.js
opCheckIsInProgressAndSaveNodeValue(node, value, simslot) operator_variant_manager.js
saveAndUpdateApnValue(node, value, simslot) operator_variant_manager.js
applySettings(mcc, mnc, updateAPN) operator_variant_handler.js updateAPN是OMADM对应的APN class 类型
applyOperatorVariantSettings(result) operator_variant_handler.js
buildApnSettings(allApnList) operator_variant_handler.js
buildPreferredApnSettings(apnSettings) operator_variant_handler.js 此接口只会被调用一次,因此在manager里面循环传参updateAPN调用applySettings()执行卡的时候,不能下发全部类型的全部APN。(存疑)
setDataProfileByType EngmodeManager.jsm

Manager通过发消息触发服务执行:

1.Services.cpmm.sendAsyncMessage("Engmode:setDataProfileByType",

2.内部收到消息在receiveMessage(aMessage)匹配case 执行

case "Engmode:setDataProfileByType:Return":
    request = this.requestMsgHdl(msg);

3.

_setDataProfileByType EngmodeService.jsm

在 buildPreferredApnSettings定制的类型会触发dataprofile下发MD,在engmode中实现。

相关工具模块

/gecko/koost/engmode/EngmodeService.jsm

在engmode实现同步APN到MD的接口

js module Interface Comment
EngmodeManager.jsm setDataProfileByType(strApnSetting, type) 管理通过消息调起服务。
EngmodeService.jsm _setDataProfileByType(networkType, profileId, apn, protocol, roamingProtocol, authType, user, password, type, maxConnsTime, maxConns, waitTime, enabled, inactivityTimer, callback)  定义服务

你可能感兴趣的:(KaiOS,Telephony,javascript,ecmascript,KaiOS,Telephony,OMADM)