release protocolV2 V894
authorSnickerSun <scy@incartech.cn>
Wed, 25 Aug 2021 16:48:53 +0000 (00:48 +0800)
committerSnickerSun <scy@incartech.cn>
Wed, 25 Aug 2021 16:48:53 +0000 (00:48 +0800)
设置APN的时候同时设为 优先选项。

app/release/ICSer_V894_2108260032_release.apk [moved from app/release/ICSer_V893_2108252240_release.apk with 77% similarity]
app/release/output.json
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_V893_2108252240_release.apk
rename to app/release/ICSer_V894_2108260032_release.apk
index 76c1d34..a766b51 100644 (file)
Binary files a/app/release/ICSer_V893_2108252240_release.apk and b/app/release/ICSer_V894_2108260032_release.apk differ
index 4c31eac..4226789 100644 (file)
@@ -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
index 35efdc7..aabeb47 100644 (file)
@@ -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();
index bedd829..944b727 100644 (file)
@@ -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);
index a8e87f3..2f1bfdd 100644 (file)
@@ -1,2 +1,2 @@
-#Wed Aug 25 22:40:43 CST 2021\r
-VERSION_CODE=893\r
+#Thu Aug 26 00:32:35 CST 2021\r
+VERSION_CODE=894\r