Loading AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ <activity android:name="ApnSettings" android:label="@string/apn_settings" android:configChanges="orientation|keyboardHidden" android:launchMode="singleInstance" android:launchMode="singleTask" > <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -2144,4 +2144,7 @@ found in the list of installed applications.</string> <string name="backup_erase_dialog_title">Settings backup</string> <!-- Dialog title for confirmation to erase backup data from server --> <string name="backup_erase_dialog_message">Are you sure you want to stop backing up your settings and erase all copies on Google servers?</string> <!-- Name to assign to a Network Access Point that was saved without a name --> <string name="untitled_apn">Untitled</string> </resources> src/com/android/settings/ApnEditor.java +18 −6 Original line number Diff line number Diff line Loading @@ -150,7 +150,7 @@ public class ApnEditor extends PreferenceActivity if (action.equals(Intent.ACTION_EDIT)) { mUri = intent.getData(); } else if (action.equals(Intent.ACTION_INSERT)) { if (mFirstTime) { if (mFirstTime || icicle.getInt(SAVED_POS) == 0) { mUri = getContentResolver().insert(intent.getData(), new ContentValues()); } else { mUri = ContentUris.withAppendedId(Telephony.Carriers.CONTENT_URI, Loading Loading @@ -185,12 +185,14 @@ public class ApnEditor extends PreferenceActivity @Override public void onResume() { super.onResume(); getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this); getPreferenceScreen().getSharedPreferences() .registerOnSharedPreferenceChangeListener(this); } @Override public void onPause() { getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this); getPreferenceScreen().getSharedPreferences() .unregisterOnSharedPreferenceChangeListener(this); super.onPause(); } Loading Loading @@ -328,9 +330,10 @@ public class ApnEditor extends PreferenceActivity @Override protected void onSaveInstanceState(Bundle icicle) { super.onSaveInstanceState(icicle); validateAndSave(true); if (validateAndSave(true)) { icicle.putInt(SAVED_POS, mCursor.getInt(ID_INDEX)); } } /** * Check the key fields' validity and save if valid. Loading Loading @@ -366,9 +369,18 @@ public class ApnEditor extends PreferenceActivity return false; } // If it's a new APN and a name or apn haven't been entered, then erase the entry if (force && mNewApn && name.length() < 1 && apn.length() < 1) { getContentResolver().delete(mUri, null, null); return false; } ContentValues values = new ContentValues(); values.put(Telephony.Carriers.NAME, name); // Add a dummy name "Untitled", if the user exits the screen without adding a name but // entered other information worth keeping. values.put(Telephony.Carriers.NAME, name.length() < 1 ? getResources().getString(R.string.untitled_apn) : name); values.put(Telephony.Carriers.APN, apn); values.put(Telephony.Carriers.PROXY, checkNotSet(mProxy.getText())); values.put(Telephony.Carriers.PORT, checkNotSet(mPort.getText())); Loading Loading
AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ <activity android:name="ApnSettings" android:label="@string/apn_settings" android:configChanges="orientation|keyboardHidden" android:launchMode="singleInstance" android:launchMode="singleTask" > <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading
res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -2144,4 +2144,7 @@ found in the list of installed applications.</string> <string name="backup_erase_dialog_title">Settings backup</string> <!-- Dialog title for confirmation to erase backup data from server --> <string name="backup_erase_dialog_message">Are you sure you want to stop backing up your settings and erase all copies on Google servers?</string> <!-- Name to assign to a Network Access Point that was saved without a name --> <string name="untitled_apn">Untitled</string> </resources>
src/com/android/settings/ApnEditor.java +18 −6 Original line number Diff line number Diff line Loading @@ -150,7 +150,7 @@ public class ApnEditor extends PreferenceActivity if (action.equals(Intent.ACTION_EDIT)) { mUri = intent.getData(); } else if (action.equals(Intent.ACTION_INSERT)) { if (mFirstTime) { if (mFirstTime || icicle.getInt(SAVED_POS) == 0) { mUri = getContentResolver().insert(intent.getData(), new ContentValues()); } else { mUri = ContentUris.withAppendedId(Telephony.Carriers.CONTENT_URI, Loading Loading @@ -185,12 +185,14 @@ public class ApnEditor extends PreferenceActivity @Override public void onResume() { super.onResume(); getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this); getPreferenceScreen().getSharedPreferences() .registerOnSharedPreferenceChangeListener(this); } @Override public void onPause() { getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this); getPreferenceScreen().getSharedPreferences() .unregisterOnSharedPreferenceChangeListener(this); super.onPause(); } Loading Loading @@ -328,9 +330,10 @@ public class ApnEditor extends PreferenceActivity @Override protected void onSaveInstanceState(Bundle icicle) { super.onSaveInstanceState(icicle); validateAndSave(true); if (validateAndSave(true)) { icicle.putInt(SAVED_POS, mCursor.getInt(ID_INDEX)); } } /** * Check the key fields' validity and save if valid. Loading Loading @@ -366,9 +369,18 @@ public class ApnEditor extends PreferenceActivity return false; } // If it's a new APN and a name or apn haven't been entered, then erase the entry if (force && mNewApn && name.length() < 1 && apn.length() < 1) { getContentResolver().delete(mUri, null, null); return false; } ContentValues values = new ContentValues(); values.put(Telephony.Carriers.NAME, name); // Add a dummy name "Untitled", if the user exits the screen without adding a name but // entered other information worth keeping. values.put(Telephony.Carriers.NAME, name.length() < 1 ? getResources().getString(R.string.untitled_apn) : name); values.put(Telephony.Carriers.APN, apn); values.put(Telephony.Carriers.PROXY, checkNotSet(mProxy.getText())); values.put(Telephony.Carriers.PORT, checkNotSet(mPort.getText())); Loading