OSDN Git Service

Settings: The APN cannot be edited after tapping right of APN
authorguangl <guangl@codeaurora.org>
Mon, 12 Sep 2016 07:35:33 +0000 (15:35 +0800)
committerguangl <guangl@codeaurora.org>
Mon, 12 Sep 2016 07:35:33 +0000 (15:35 +0800)
Fix the APN can be edited after tapping the right of APN
in CU mode.
Keep the same when user click the left and right of APN.

Change-Id: Ied5e4f74fab6dfb38352051bd2d1cfe435b2f09b
CRs-Fixed: 1041617

src/com/android/settings/ApnPreference.java
src/com/android/settings/ApnSettings.java

index b5ff5d3..fd0e143 100644 (file)
@@ -135,4 +135,8 @@ public class ApnPreference extends Preference implements
     public void setApnReadOnly(boolean apnReadOnly) {
         mApnReadOnly = apnReadOnly;
     }
+
+    public boolean getApnReadOnly() {
+        return mApnReadOnly;
+    }
 }
index bea7d66..f95851f 100755 (executable)
@@ -462,7 +462,11 @@ public class ApnSettings extends RestrictedSettingsFragment implements
     public boolean onPreferenceTreeClick(Preference preference) {
         int pos = Integer.parseInt(preference.getKey());
         Uri url = ContentUris.withAppendedId(Telephony.Carriers.CONTENT_URI, pos);
-        startActivity(new Intent(Intent.ACTION_EDIT, url));
+        Intent intent = new Intent(Intent.ACTION_EDIT, url);
+        if (preference instanceof ApnPreference) {
+            intent.putExtra("DISABLE_EDITOR", ((ApnPreference) preference).getApnReadOnly());
+        }
+        startActivity(intent);
         return true;
     }