-[{"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
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;
public class APNUtil {
private static Phone mPhone=null;
+
+ //暂未启用这种方式。无效
public static void enableRoaming(Context context,boolean roaming) {
String phoneFactoryName = "com.android.internal.telephony.PhoneFactory";
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();
}
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() {
}
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);