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

Commit a05db0fa authored by goneil's avatar goneil Committed by Gil O'Neil
Browse files

Set EDITED column to USER_EDITED when editing APN

TelephonyProvider switched from defaulting EDITED to USER_EDITED and now
defaults to CARRIER_EDITED in https://android-review.googlesource.com/c/platform/packages/providers/TelephonyProvider/+/570244.
Therefore, when the user edits the APN, we can no longer rely on the
default implementation

Bug: 67750905
Test: None
Change-Id: I4996b24da94f7c1883c3c802b8edd5e23db580b2
parent d46153c3
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -249,7 +249,9 @@ public class ApnEditor extends SettingsPreferenceFragment
                    finish();
                    return;
                }
                mUri = getContentResolver().insert(uri, new ContentValues());
                ContentValues contentValues = new ContentValues();
                contentValues.put(Telephony.Carriers.EDITED, Telephony.Carriers.USER_EDITED);
                mUri = getContentResolver().insert(uri, contentValues);
            } else {
                mUri = ContentUris.withAppendedId(Telephony.Carriers.CONTENT_URI,
                        icicle.getInt(SAVED_POS));
@@ -464,7 +466,9 @@ public class ApnEditor extends SettingsPreferenceFragment
        if (mUri == null && mNewApn) {
            // The URI could have been deleted when activity is paused,
            // therefore, it needs to be restored.
            mUri = getContentResolver().insert(getIntent().getData(), new ContentValues());
            ContentValues contentValues = new ContentValues();
            contentValues.put(Telephony.Carriers.EDITED, Telephony.Carriers.USER_EDITED);
            mUri = getContentResolver().insert(getIntent().getData(), contentValues);
            if (mUri == null) {
                Log.w(TAG, "Failed to insert new telephony provider into "
                        + getIntent().getData());
@@ -1044,6 +1048,8 @@ public class ApnEditor extends SettingsPreferenceFragment
                callUpdate,
                CARRIER_ENABLED_INDEX);

        values.put(Telephony.Carriers.EDITED, Telephony.Carriers.USER_EDITED);

        if (callUpdate) {
            getContentResolver().update(mUri, values, null, null);
        } else {