背景
Android V MTK修改了APN 匹配的逻辑,原本直接override updateDataProfiles 更新APN的逻辑,现在回到 AOSP DPM 中实现,MTK 只定制查询的URI。
功能逻辑
关键接口
- [DPM] updateDataProfiles(forceUpdateIa) 发起匹配APN
- [MtkDPM] isApnQueryable() 查询APN
- [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