From: SnickerSun Date: Wed, 25 Aug 2021 16:48:53 +0000 (+0800) Subject: release protocolV2 V894 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=923c4ad50716c2b8f2bb8598fa9f217b2090fa28;p=protocol_srv.git release protocolV2 V894 设置APN的时候同时设为 优先选项。 --- diff --git a/app/release/ICSer_V893_2108252240_release.apk b/app/release/ICSer_V894_2108260032_release.apk similarity index 77% rename from app/release/ICSer_V893_2108252240_release.apk rename to app/release/ICSer_V894_2108260032_release.apk index 76c1d346..a766b511 100644 Binary files a/app/release/ICSer_V893_2108252240_release.apk and b/app/release/ICSer_V894_2108260032_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index 4c31eac0..42267890 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":893,"versionName":"2108252240","enabled":true,"outputFile":"ICSer_V893_2108252240_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V893_2108252240_release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":894,"versionName":"2108260032","enabled":true,"outputFile":"ICSer_V894_2108260032_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V894_2108260032_release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/com/enqualcomm/support/utils/APNUtil.java b/app/src/main/java/com/enqualcomm/support/utils/APNUtil.java index 35efdc78..aabeb471 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/APNUtil.java +++ b/app/src/main/java/com/enqualcomm/support/utils/APNUtil.java @@ -13,6 +13,7 @@ import android.widget.Toast; import com.android.internal.telephony.Phone; import com.android.internal.telephony.PhoneFactory; +import com.enqualcomm.support.CoreService; import com.enqualcomm.support.bean.ApnSetting; import android.sim.SimManager; @@ -21,6 +22,8 @@ import java.lang.reflect.Method; public class APNUtil { private static Phone mPhone=null; + + //暂未启用这种方式。无效 public static void enableRoaming(Context context,boolean roaming) { String phoneFactoryName = "com.android.internal.telephony.PhoneFactory"; @@ -62,6 +65,7 @@ public class APNUtil { boolean isAddSuccess=AddNewApn(apnName,apn,mcc,mnc,user,passwd,context); if (isAddSuccess) { + APNUtil.selectAPN(mcc,mnc,apn, context); ICLogger.i("APN 添加成功!"); return true; // Toast.makeText(NewAPNActivity.this, "新增APN成功", Toast.LENGTH_SHORT).show(); diff --git a/app/src/main/java/com/enqualcomm/support/utils/ApnEditor.java b/app/src/main/java/com/enqualcomm/support/utils/ApnEditor.java index bedd8297..944b7279 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/ApnEditor.java +++ b/app/src/main/java/com/enqualcomm/support/utils/ApnEditor.java @@ -229,18 +229,22 @@ public class ApnEditor { } public void setSelectedApnKey(String key) { - //s mSelectedKey = key; - ContentResolver resolver = mContext.getContentResolver(); - ContentValues values = new ContentValues(); - /* SPRD: for multi-sim @{ */ - // values.put(APN_ID, mSelectedKey); - // resolver.update(PREFERAPN_URI, values, null, null); - values.put("apn_id", key); - resolver.update( - Telephony.Carriers.getContentUri(0, Telephony.Carriers.PATH_PREFERAPN), - values, null, null); - /* @} */ + try { + //s mSelectedKey = key; + ContentResolver resolver = mContext.getContentResolver(); + + ContentValues values = new ContentValues(); + // values.put(APN_ID, mSelectedKey); + // resolver.update(PREFERAPN_URI, values, null, null); + values.put("apn_id", key); + resolver.insert(Telephony.Carriers.getContentUri(0, Telephony.Carriers.PATH_PREFERAPN), values); +// resolver.update( +// Telephony.Carriers.getContentUri(0, Telephony.Carriers.PATH_PREFERAPN), +// values, null, null); + }catch (Exception e){ + ICLogger.e(e.getMessage(),e); + } } public String getSelectedApnKey() { @@ -372,7 +376,7 @@ public class ApnEditor { } where += " and name!='CMCC DM'"; - Log.d(TAG,"where = " + where + ",mccmnc =" + mccmnc); + Log.d(TAG,"where = " + where + ",mccmnc =" + mccmnc+" , type like 'default'"); // mCursor = mContext.getContentResolver().query(mAPNUri, new String[] { // "_id", "name", "apn", "type", "mvno_type", "mvno_match_data" }, where, null, // Telephony.Carriers.DEFAULT_SORT_ORDER); diff --git a/app/version_code.properties b/app/version_code.properties index a8e87f34..2f1bfddd 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Wed Aug 25 22:40:43 CST 2021 -VERSION_CODE=893 +#Thu Aug 26 00:32:35 CST 2021 +VERSION_CODE=894