Android V 加载APN的代码实现更新(MTK)

背景

Android V MTK修改了APN 匹配的逻辑,原本直接override updateDataProfiles 更新APN的逻辑,现在回到 AOSP DPM 中实现,MTK 只定制查询的URI。

功能逻辑

关键接口

  1. [DPM] updateDataProfiles(forceUpdateIa) 发起匹配APN
  2. [MtkDPM] isApnQueryable() 查询APN
  3. [DPM] getApnListCursor() 获取cursor,MTK覆写了

1、[DPM] updateDataProfiles 更新会先通过 isApnQueryable(新增接口)判断控制查询数据库逻辑和参数信息——子类没有覆写就用父类的。

    public void updateDataProfiles(boolean forceUpdateIa) {
        List<DataProfile> profiles = new ArrayList<>();
        /// M: performance enhancement @{    
        if (isApnQueryable()) {    //定制控制,为什么没有else?
            Cursor cursor = getApnListCursor();
            /// M: @}
            if (cursor == null) {
                loge("Cannot access APN database through telephony provider.");
                return;
            }
            //省略
        }
        /// M: appendExtraDataProfiles @{
        appendExtraDataProfiles(profiles);
        /// M: @}
    }


    /**
     * mtk isApnQueryable, performance enhancement can be true earlier.
     */
    protected boolean isApnQueryable() {
        return mDataConfigManager.isConfigCarrierSpecific();
    }



    /**
     * mtk getApnListCursor, performance enhancement can get it earlier.
     */
    protected Cursor getApnListCursor() {
        Cursor cursor = mPhone.getCont
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值