From b4ac40b2046d77417349870aa0acd0843b6d6f02 Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Mon, 24 Apr 2017 11:02:03 -0700 Subject: [PATCH] Do not call update() for read only APNs. Calling update marks the APN USER_EDITED and thus makes it user editable. Test: manual Bug: 37607890 Change-Id: Ia5aa0df470e04c8bcc58080577cc3da2ab6dc9df --- 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 f97811c0e17..f668957f1e7 100644 --- a/src/com/android/settings/ApnEditor.java +++ b/src/com/android/settings/ApnEditor.java @@ -788,9 +788,14 @@ public class ApnEditor extends SettingsPreferenceFragment * Check the key fields' validity and save if valid. * @param force save even if the fields are not valid, if the app is * being suspended - * @return true if the data was saved + * @return true if there's no error */ private boolean validateAndSave(boolean force) { + // nothing to do if it's a read only APN + if (mReadOnlyApn) { + return true; + } + String name = checkNotSet(mName.getText()); String apn = checkNotSet(mApn.getText()); String mcc = checkNotSet(mMcc.getText());