From 07c620a49326fe94ee19d3eb92dba416bae05421 Mon Sep 17 00:00:00 2001 From: jianzhou Date: Wed, 4 Nov 2015 14:00:11 +0800 Subject: Settings: Set the default protocol as "PROTOCOL_IPV4V6" when created Set the default protocol as "IPV4V6" when created, take it as a common requirement. Change-Id: I3564c499a1a8898c1b9b13a7ef631a51e02c4457 --- src/com/android/settings/ApnEditor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/ApnEditor.java b/src/com/android/settings/ApnEditor.java index 013d754..a131510 100644 --- a/src/com/android/settings/ApnEditor.java +++ b/src/com/android/settings/ApnEditor.java @@ -60,6 +60,8 @@ public class ApnEditor extends InstrumentedPreferenceActivity private final static String KEY_BEARER_MULTI = "bearer_multi"; private final static String KEY_MVNO_TYPE = "mvno_type"; + private final static String PROTOCOL_IPV4V6= "IPV4V6"; + private static final int MENU_DELETE = Menu.FIRST; private static final int MENU_SAVE = Menu.FIRST + 1; private static final int MENU_CANCEL = Menu.FIRST + 2; @@ -216,7 +218,10 @@ public class ApnEditor extends InstrumentedPreferenceActivity mUri = intent.getData(); } else if (action.equals(Intent.ACTION_INSERT)) { if (mFirstTime || icicle.getInt(SAVED_POS) == 0) { - mUri = getContentResolver().insert(intent.getData(), new ContentValues()); + ContentValues values = new ContentValues(); + values.put(Telephony.Carriers.PROTOCOL, PROTOCOL_IPV4V6); + values.put(Telephony.Carriers.ROAMING_PROTOCOL, PROTOCOL_IPV4V6); + mUri = getContentResolver().insert(intent.getData(), values); } else { mUri = ContentUris.withAppendedId(Telephony.Carriers.CONTENT_URI, icicle.getInt(SAVED_POS)); -- cgit v1.1