release protocolV2 V896
authorSnickerSun <scy@incartech.cn>
Thu, 26 Aug 2021 13:09:42 +0000 (21:09 +0800)
committerSnickerSun <scy@incartech.cn>
Thu, 26 Aug 2021 13:09:42 +0000 (21:09 +0800)
APN添加 后直接设为默认选项。保证配置结果可用。
APN current 返回内容更加准确。
默认 选择 APN "334","020","ctm-mobile" 解决客户无法直接使用问题。

app/release/ICSer_V896_2108262106_release.apk [moved from app/release/ICSer_V895_2108260209_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_V895_2108260209_release.apk
rename to app/release/ICSer_V896_2108262106_release.apk
index fe63f97..1e35e57 100644 (file)
Binary files a/app/release/ICSer_V895_2108260209_release.apk and b/app/release/ICSer_V896_2108262106_release.apk differ
index fbe78ea..07aff07 100644 (file)
@@ -1 +1 @@
-[{"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
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":896,"versionName":"2108262106","enabled":true,"outputFile":"ICSer_V896_2108262106_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V896_2108262106_release.apk","properties":{}}]
\ No newline at end of file
index d84c8ba..816bb4e 100644 (file)
@@ -915,8 +915,8 @@ public class CoreService extends Service {
                 @Override
                 public void run() {
                     //L004PT ,L005 默认开启roaming以及默认使用以下apn
-                    APNUtil.insertAPN("240","07","NXT17.NET",CoreService.getInstance());
-                    APNUtil.insertAPN("334","020","ctm-mobile",CoreService.getInstance());
+//                    APNUtil.addVPN("Test","tapn","460","04","","",CoreService.getInstance());
+                    APNUtil.selectAPN("334","020","ctm-mobile",CoreService.getInstance());
                 }
             },5000);
 
index 5bc4408..d559038 100644 (file)
@@ -90,10 +90,6 @@ public class APNUtil {
         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 bb3c8c5..c2d231e 100644 (file)
@@ -289,21 +289,13 @@ public class ApnEditor {
     public void setDefaultAPN(String apn, String mccmnc){
         String apnid=queryApnID(apn,mccmnc);
         String currentapnid=getSelectedApnKey();
-        ICLogger.d("current APN key "+apnid +" selected APN key " + currentapnid);
+        ICLogger.d(apn+"  "+mccmnc+ " current APN key "+apnid +" selected APN key " + currentapnid);
         setSelectedApnKey(apnid);
         currentapnid=getSelectedApnKey();
-        ICLogger.d("after set APN key "+apnid +" selected APN key " + currentapnid);
+        ICLogger.d(apn+"  "+mccmnc+" 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) {
 
         String where;
@@ -311,10 +303,10 @@ public class ApnEditor {
         where += " and name!='CMCC DM'";
         where += " and apn='"+apn+"'";
 
-        Log.d(TAG,"where = " + where + ",mccmnc =" + mccmnc);
+        Log.d(TAG,"where = " + where );
         mCursor = mContext.getContentResolver().query(mAPNUri, sProjection, where, null, Telephony.Carriers.DEFAULT_SORT_ORDER);
         String apnsetings="";
-        if (mCursor.moveToFirst()) {
+        if (mCursor!=null && mCursor.moveToFirst()) {
 
             fill_apnSettings(mCursor,mApnSetting);
             apnsetings+= mApnSetting.toShortString();
@@ -332,16 +324,16 @@ public class ApnEditor {
         return mApnSetting.getID();
     }
 
-        public String queryApn(String apn,String mccmnc){
+    public String queryApn(String apn,String mccmnc){
         String where;
         where = "numeric=\"" + mccmnc + "\"";
         where += " and name!='CMCC DM'";
-        where += " and apn='"+apn+"'";
+        where += " and like '%default%' and apn='"+apn+"'";
 
-        Log.d(TAG,"where = " + where + ",mccmnc =" + mccmnc);
+        Log.d(TAG,"where = " + where );
         mCursor = mContext.getContentResolver().query(mAPNUri, sProjection, where, null, Telephony.Carriers.DEFAULT_SORT_ORDER);
         String apnsetings="";
-        if (mCursor.moveToFirst()) {
+        if (mCursor!=null && mCursor.moveToFirst()) {
 
             fill_apnSettings(mCursor,mApnSetting);
             apnsetings+= mApnSetting.toShortString();
@@ -360,12 +352,12 @@ public class ApnEditor {
     public String queryApn(String mccmnc){
         String where;
         where = "numeric=\"" + mccmnc + "\"";
-        where += " and name!='CMCC DM'";
+        where += " and like '%default%' and name!='CMCC DM'";
 
-        Log.d(TAG,"where = " + where + ",mccmnc =" + mccmnc);
+        Log.d(TAG,"where = " + where );
         mCursor = mContext.getContentResolver().query(mAPNUri, sProjection, where, null, Telephony.Carriers.DEFAULT_SORT_ORDER);
         String apnsetings="";
-        if (mCursor.moveToFirst()) {
+        if (mCursor!=null && mCursor.moveToFirst()) {
 
             fill_apnSettings(mCursor,mApnSetting);
             apnsetings+= mApnSetting.toShortString();
@@ -398,19 +390,17 @@ public class ApnEditor {
             mccmnc = android.os.SystemProperties.get(
                     TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, "");
             where = "numeric=\"" + mccmnc + "\"";
-
         }
-        where += " and name!='CMCC DM'";
+        where += " and type like '%default%' and name!='CMCC DM'";
 
-        Log.d(TAG,"where = " + where + ",mccmnc =" + mccmnc+" , type like 'default'");
+        Log.d(TAG,"where = " + where );
 //        mCursor = mContext.getContentResolver().query(mAPNUri, new String[] {
 //                        "_id", "name", "apn", "type", "mvno_type", "mvno_match_data" }, where, null,
 //                Telephony.Carriers.DEFAULT_SORT_ORDER);
         mCursor = mContext.getContentResolver().query(mAPNUri, sProjection, where, null, Telephony.Carriers.DEFAULT_SORT_ORDER);
 //        mCursor = mContext.getContentResolver().query(mAPNUri, sProjection, null, null, null);
         String apnsetings="";
-        if (mCursor.moveToFirst()) {
-
+        if (mCursor!=null && mCursor.moveToFirst()) {
             fill_apnSettings(mCursor,mApnSetting);
             apnsetings+= mApnSetting.toShortString();
             while (mCursor.moveToNext()){
@@ -424,7 +414,7 @@ public class ApnEditor {
             mCursor = null;
         }
         String currentApnid=getSelectedApnKey();
-        return apnsetings + ";currentApnID=" +currentApnid ;
+        return apnsetings + "; Prefer ApnID=" +currentApnid ;
     }
 
     public boolean resetAPNtoDefault(){
@@ -453,9 +443,9 @@ public class ApnEditor {
             {
                 ICLogger.d( "Get mUri again! mUri="+mUri.toString());
                 mCursor = mContext.getContentResolver().query(mUri, sProjection, null, null, null);
-                mCursor.moveToFirst();
-
-                fill_apnSettings(mCursor,mApnSetting);
+                if (mCursor!=null &&  mCursor.moveToFirst()) {
+                    fill_apnSettings(mCursor, mApnSetting);
+                }
                 mApnSetting.setmNameStr(checkNull(apnName));
                 mApnSetting.setmApnStr(checkNull(apn));
                 mApnSetting.setmMccStr(checkNull(mcc));
index 6e480cf..e287aa4 100644 (file)
@@ -1,2 +1,2 @@
-#Thu Aug 26 02:09:11 CST 2021\r
-VERSION_CODE=895\r
+#Thu Aug 26 21:06:10 CST 2021\r
+VERSION_CODE=896\r