微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > OMA CP收到同名APN配置需要作为同一条APN配置显示在APN配置界面

OMA CP收到同名APN配置需要作为同一条APN配置显示在APN配置界面

时间:10-02 整理:3721RD 点击:
[DESCRIPTION]
有些运营商要求在收到同名APN配置的时候,无论配置内容是否相同,在APN配置界面都只显示一条
[SOLUTION]
需要对如下文件做修改
1.OmacpApnReceiverService.java文件,如下code地方增加else分支
if (replaceNum == APN_NO_UPDATE) {
values = addMVNOItem(values,slotId);
try {
Uri newRow = context.getContentResolver().insert(uri, values);
if (newRow != null) {
Xlog.d(TAG, "uri = " + newRow);
if (newRow.getPathSegments().size() == 2) {
insertNum = Long.parseLong(newRow.getLastPathSegment());
Xlog.d(TAG, "insert row id = " + insertNum);
}
}
} catch (SQLException e) {
Xlog.d(TAG, "insert SQLException happened!");
mResult = false;
}
}
//mtk add APN start
else{
values = addMVNOItem(values,slotId);
try{
Uri updatedUri = ContentUris.withAppendedId(uri, replaceNum);
context.getContentResolver().update(updatedUri, values, null, null);
} catch(SQLException e){
Xlog.d(TAG, "update SQLException happend!");
mResult = false;
}
}
//MTK add APN end
2.DefaultReplaceApnProfile.Java 文件如下判断处修改如下
try {
//here we add name
cursor = context.getContentResolver().query(uri,
new String[] { Telephony.Carriers._ID, Telephony.Carriers.OMACPID, "name" }, where, null,
Telephony.Carriers.DEFAULT_SORT_ORDER);
//
while (!cursor.isAfterLast()) {
Xlog.d(TAG,"apnId " + apnId + " getApnId = " + cursor.getString(1));
Xlog.d(TAG,"name" +name + "get name fROM DB=" + cursor.getString(2));
//if (apnId.equals(cursor.getString(1))) {
if (apnId.equals(cursor.getString(1)) || name.equals(cursor.getString(2))) {
numReplaced = cursor.getInt(0);
break;

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top