Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d8d9808 authored by Amit Mahajan's avatar Amit Mahajan Committed by android-build-merger
Browse files

Merge "Change to not cache user entered apn type as user may change it." into oc-dr1-dev

am: d1c3bb13

Change-Id: If5018f14c636f6634e70771471ee6ee2103a0ede
parents f366a871 d1c3bb13
Loading
Loading
Loading
Loading
+7 −13
Original line number Original line Diff line number Diff line
@@ -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.
@@ -216,7 +215,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);
@@ -1120,15 +1118,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);
@@ -1146,12 +1140,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 {