Merge "Change to not cache user entered apn type as user may change it."

am: 54eeafa052

Change-Id: I33e32ee2d4a9e09f1fb6c383eb7e1d7e8a081c2c
This commit is contained in:
Amit Mahajan
2017-08-22 21:09:12 +00:00
committed by android-build-merger

View File

@@ -118,7 +118,6 @@ public class ApnEditor extends SettingsPreferenceFragment
private String[] mReadOnlyApnTypes; private String[] mReadOnlyApnTypes;
private String[] mReadOnlyApnFields; private String[] mReadOnlyApnFields;
private boolean mReadOnlyApn; private boolean mReadOnlyApn;
private String mUserEnteredApnType;
/** /**
* Standard projection for the interesting columns of a normal note. * Standard projection for the interesting columns of a normal note.
@@ -214,7 +213,6 @@ public class ApnEditor extends SettingsPreferenceFragment
mReadOnlyApn = false; mReadOnlyApn = false;
mReadOnlyApnTypes = null; mReadOnlyApnTypes = null;
mReadOnlyApnFields = null; mReadOnlyApnFields = null;
mUserEnteredApnType = null;
CarrierConfigManager configManager = (CarrierConfigManager) CarrierConfigManager configManager = (CarrierConfigManager)
getSystemService(Context.CARRIER_CONFIG_SERVICE); getSystemService(Context.CARRIER_CONFIG_SERVICE);
@@ -1117,15 +1115,11 @@ public class ApnEditor extends SettingsPreferenceFragment
} }
private String getUserEnteredApnType() { private String getUserEnteredApnType() {
if (mUserEnteredApnType != null) {
return mUserEnteredApnType;
}
// if user has not specified a type, map it to "ALL APN TYPES THAT ARE NOT READ-ONLY" // if user has not specified a type, map it to "ALL APN TYPES THAT ARE NOT READ-ONLY"
mUserEnteredApnType = mApnType.getText(); String userEnteredApnType = mApnType.getText();
if (mUserEnteredApnType != null) mUserEnteredApnType = mUserEnteredApnType.trim(); if (userEnteredApnType != null) userEnteredApnType = userEnteredApnType.trim();
if ((TextUtils.isEmpty(mUserEnteredApnType) if ((TextUtils.isEmpty(userEnteredApnType)
|| PhoneConstants.APN_TYPE_ALL.equals(mUserEnteredApnType)) || PhoneConstants.APN_TYPE_ALL.equals(userEnteredApnType))
&& !ArrayUtils.isEmpty(mReadOnlyApnTypes)) { && !ArrayUtils.isEmpty(mReadOnlyApnTypes)) {
StringBuilder editableApnTypes = new StringBuilder(); StringBuilder editableApnTypes = new StringBuilder();
List<String> readOnlyApnTypes = Arrays.asList(mReadOnlyApnTypes); List<String> readOnlyApnTypes = Arrays.asList(mReadOnlyApnTypes);
@@ -1143,12 +1137,12 @@ public class ApnEditor extends SettingsPreferenceFragment
editableApnTypes.append(apnType); editableApnTypes.append(apnType);
} }
} }
mUserEnteredApnType = editableApnTypes.toString(); userEnteredApnType = editableApnTypes.toString();
Log.d(TAG, "getUserEnteredApnType: changed apn type to editable apn types: " Log.d(TAG, "getUserEnteredApnType: changed apn type to editable apn types: "
+ mUserEnteredApnType); + userEnteredApnType);
} }
return mUserEnteredApnType; return userEnteredApnType;
} }
public static class ErrorDialog extends InstrumentedDialogFragment { public static class ErrorDialog extends InstrumentedDialogFragment {