package com.android.settings;
+import static android.provider.Telephony.Carriers.CONTENT_URI;
import static android.provider.Telephony.Carriers.ENFORCE_MANAGED_URI;
import static android.provider.Telephony.Carriers.FILTERED_URI;
mSelectedKey = getSelectedApnKey();
cursor.moveToFirst();
+ boolean enforced = isDpcApnEnforced();
while (!cursor.isAfterLast()) {
String name = cursor.getString(NAME_INDEX);
String apn = cursor.getString(APN_INDEX);
pref.setPersistent(false);
pref.setOnPreferenceChangeListener(this);
pref.setSubId(subId);
+ pref.setDpcEnforced(enforced);
boolean selectable = ((type == null) || !type.equals("mms"));
pref.setSelectable(selectable);
@Override
public boolean onPreferenceTreeClick(Preference preference) {
int pos = Integer.parseInt(preference.getKey());
- Uri url = ContentUris.withAppendedId(FILTERED_URI, pos);
+ Uri url = ContentUris.withAppendedId(isDpcApnEnforced() ? FILTERED_URI : CONTENT_URI, pos);
startActivity(new Intent(Intent.ACTION_EDIT, url));
return true;
}