release protocolV2 V895 l005_l004pt
authorSnickerSun <scy@incartech.cn>
Wed, 25 Aug 2021 18:17:53 +0000 (02:17 +0800)
committerSnickerSun <scy@incartech.cn>
Wed, 25 Aug 2021 18:17:53 +0000 (02:17 +0800)
默认添加CTM-mobile apn 优先选择配置
修改 设置apn是为update 优先选择配置项。

app/release/ICSer_V895_2108260209_release.apk [moved from app/release/ICSer_V894_2108260032_release.apk with 77% similarity]
app/release/output.json
app/src/main/java/com/enqualcomm/support/CoreService.java
app/src/main/java/com/enqualcomm/support/utils/APNUtil.java
app/src/main/java/com/enqualcomm/support/utils/ApnEditor.java
app/version_code.properties

similarity index 77%
rename from app/release/ICSer_V894_2108260032_release.apk
rename to app/release/ICSer_V895_2108260209_release.apk
index a766b51..fe63f97 100644 (file)
Binary files a/app/release/ICSer_V894_2108260032_release.apk and b/app/release/ICSer_V895_2108260209_release.apk differ
index 4226789..fbe78ea 100644 (file)
@@ -1 +1 @@
-[{"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
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":895,"versionName":"2108260209","enabled":true,"outputFile":"ICSer_V895_2108260209_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V895_2108260209_release.apk","properties":{}}]
\ No newline at end of file
index e8e6296..d84c8ba 100644 (file)
@@ -915,7 +915,8 @@ public class CoreService extends Service {
                 @Override
                 public void run() {
                     //L004PT ,L005 默认开启roaming以及默认使用以下apn
-                    APNUtil.selectAPN("240","07","NXT17.NET",CoreService.getInstance());
+                    APNUtil.insertAPN("240","07","NXT17.NET",CoreService.getInstance());
+                    APNUtil.insertAPN("334","020","ctm-mobile",CoreService.getInstance());
                 }
             },5000);
 
index aabeb47..5bc4408 100644 (file)
@@ -89,6 +89,11 @@ public class APNUtil {
         ApnEditor.getApnEditorInstance(context).setDefaultAPN(apn,mcc+mnc);
         return true;
     }
+
+    public static boolean insertAPN(String mcc,String mnc,String apn,Context context) {
+        ApnEditor.getApnEditorInstance(context).insertDefaultAPN(apn,mcc+mnc);
+        return true;
+    }
     public static boolean checkAPN(String mcc,String mnc,String apn,Context context) {
         // 检查系统已经写入的APN
         String found="";
index 944b727..bb3c8c5 100644 (file)
@@ -227,8 +227,7 @@ public class ApnEditor {
         mTelephonyManager = (TelephonyManager) mContext.getSystemService(TELEPHONY_SERVICE);
 
     }
-
-    public  void setSelectedApnKey(String key) {
+    public  void insertSelectedApnKey(String key) {
 
         try {
             //s mSelectedKey = key;
@@ -238,6 +237,7 @@ public class ApnEditor {
             // 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),
@@ -246,6 +246,23 @@ public class ApnEditor {
             ICLogger.e(e.getMessage(),e);
         }
     }
+    public  void setSelectedApnKey(String key) {
+
+        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.update(
+                Telephony.Carriers.getContentUri(0, Telephony.Carriers.PATH_PREFERAPN),
+                values, null, null);
+        }catch (Exception e){
+            ICLogger.e(e.getMessage(),e);
+        }
+    }
 
     public  String getSelectedApnKey() {
         String key = null;
@@ -277,6 +294,15 @@ public class ApnEditor {
         currentapnid=getSelectedApnKey();
         ICLogger.d("after set APN key "+apnid +" selected APN key " + currentapnid);
 
+    }
+    public void insertDefaultAPN(String apn, String mccmnc){
+        String apnid=queryApnID(apn,mccmnc);
+        String currentapnid=getSelectedApnKey();
+        ICLogger.d("current APN key "+apnid +" selected APN key " + currentapnid);
+        insertSelectedApnKey(apnid);
+        currentapnid=getSelectedApnKey();
+        ICLogger.d("after set APN key "+apnid +" selected APN key " + currentapnid);
+
     }
     public String queryApnID(String apn,String mccmnc) {
 
@@ -397,7 +423,8 @@ public class ApnEditor {
             mCursor.close();
             mCursor = null;
         }
-        return apnsetings;
+        String currentApnid=getSelectedApnKey();
+        return apnsetings + ";currentApnID=" +currentApnid ;
     }
 
     public boolean resetAPNtoDefault(){
index 2f1bfdd..6e480cf 100644 (file)
@@ -1,2 +1,2 @@
-#Thu Aug 26 00:32:35 CST 2021\r
-VERSION_CODE=894\r
+#Thu Aug 26 02:09:11 CST 2021\r
+VERSION_CODE=895\r