|
@@ -121,7 +121,6 @@ public class DatabaseHelper {
|
|
|
cursor.close();
|
|
|
return arrayList;
|
|
|
}
|
|
|
- Log.d(TAG, "getApnList: db ok");
|
|
|
do {
|
|
|
ApnModel bean = new ApnModel();
|
|
|
bean._id = cursor.getString(cursor.getColumnIndex("_id"));
|
|
@@ -155,6 +154,7 @@ public class DatabaseHelper {
|
|
|
}
|
|
|
|
|
|
public static int insertAPN(Context context, ApnModel model) {
|
|
|
+ Log.d(TAG, "====== insertAPN ========: " + model.apn_id);
|
|
|
if (Macros.DEBUG) {
|
|
|
return -1;
|
|
|
} else {
|
|
@@ -181,54 +181,52 @@ public class DatabaseHelper {
|
|
|
values.put("mvno_type", model.mvno_type);
|
|
|
values.put("mvno_match_data", model.mvno_match_data);
|
|
|
Uri returnUri = context.getContentResolver().insert(uri, values);
|
|
|
- Log.d(TAG, "insertAPN: " + returnUri.toString());
|
|
|
+ Log.d(TAG, "insertAPN row: " + returnUri.toString());
|
|
|
String s = getLastPart(returnUri.toString());
|
|
|
return Integer.parseInt(s);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void updateAPN(Context context, ApnModel model) {
|
|
|
+ Log.d(TAG, "====== updateAPN =======: " + model.apn_id);
|
|
|
if (Macros.DEBUG) {
|
|
|
|
|
|
} else {
|
|
|
- new Thread(()->{
|
|
|
- Uri uri = Uri.parse(DB_GOPLAY_APN + "/" + model._id);
|
|
|
- ContentValues values = new ContentValues();
|
|
|
- values.put("apn_id", model.apn_id);
|
|
|
- values.put("name", model.name);
|
|
|
- values.put("apn_name", model.apn_name);
|
|
|
- values.put("user_name", model.user_name);
|
|
|
- values.put("password", model.password);
|
|
|
- values.put("mcc", model.mcc);
|
|
|
- values.put("mnc", model.mnc);
|
|
|
- values.put("proxy", model.proxy);
|
|
|
- values.put("port", model.port);
|
|
|
- values.put("server", model.server);
|
|
|
- values.put("mmsc", model.mmsc);
|
|
|
- values.put("mmsproxy", model.mmsproxy);
|
|
|
- values.put("mmsport", model.mmsport);
|
|
|
- values.put("auth_type", model.auth_type);
|
|
|
- values.put("apn_type", model.apn_type);
|
|
|
- values.put("apn_protocol", model.apn_protocol);
|
|
|
- values.put("apn_roaming_protocol", model.apn_roaming_protocol);
|
|
|
- values.put("bearer", model.bearer);
|
|
|
- values.put("mvno_type", model.mvno_type);
|
|
|
- values.put("mvno_match_data", model.mvno_match_data);
|
|
|
- int row = context.getContentResolver().update(uri, values, null, null);
|
|
|
- Log.d(TAG, "updateAPN: " + row);
|
|
|
- }).start();
|
|
|
+ Uri uri = Uri.parse(DB_GOPLAY_APN + "/" + model._id);
|
|
|
+ ContentValues values = new ContentValues();
|
|
|
+ values.put("apn_id", model.apn_id);
|
|
|
+ values.put("name", model.name);
|
|
|
+ values.put("apn_name", model.apn_name);
|
|
|
+ values.put("user_name", model.user_name);
|
|
|
+ values.put("password", model.password);
|
|
|
+ values.put("mcc", model.mcc);
|
|
|
+ values.put("mnc", model.mnc);
|
|
|
+ values.put("proxy", model.proxy);
|
|
|
+ values.put("port", model.port);
|
|
|
+ values.put("server", model.server);
|
|
|
+ values.put("mmsc", model.mmsc);
|
|
|
+ values.put("mmsproxy", model.mmsproxy);
|
|
|
+ values.put("mmsport", model.mmsport);
|
|
|
+ values.put("auth_type", model.auth_type);
|
|
|
+ values.put("apn_type", model.apn_type);
|
|
|
+ values.put("apn_protocol", model.apn_protocol);
|
|
|
+ values.put("apn_roaming_protocol", model.apn_roaming_protocol);
|
|
|
+ values.put("bearer", model.bearer);
|
|
|
+ values.put("mvno_type", model.mvno_type);
|
|
|
+ values.put("mvno_match_data", model.mvno_match_data);
|
|
|
+ int row = context.getContentResolver().update(uri, values, null, null);
|
|
|
+ Log.d(TAG, "updateAPN row: " + row);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void deleteAPN(Context context, String _id) {
|
|
|
+ Log.d(TAG, "====== deleteAPN =======: " + _id);
|
|
|
if (Macros.DEBUG) {
|
|
|
|
|
|
} else {
|
|
|
- new Thread(()->{
|
|
|
- Uri uri = Uri.parse(DB_GOPLAY_APN + "/" + _id);
|
|
|
- int row = context.getContentResolver().delete(uri, null, null);
|
|
|
- Log.d(TAG, "updateAPN: " + row);
|
|
|
- }).start();
|
|
|
+ Uri uri = Uri.parse(DB_GOPLAY_APN + "/" + _id);
|
|
|
+ int row = context.getContentResolver().delete(uri, null, null);
|
|
|
+ Log.d(TAG, "deleteAPN row: " + row);
|
|
|
}
|
|
|
}
|
|
|
|