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

Commit 1285b129 authored by Amit Mahajan's avatar Amit Mahajan Committed by android-build-merger
Browse files

Merge "Move SMS raw db deletion to phone process." am: 479ec92c

am: f784db5c

Change-Id: Ib90080a6fad7ad8914390df8e4aa92749669f1a9
parents 8b8bf4c3 f784db5c
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -154,20 +154,9 @@ public class ResetNetworkConfirm extends InstrumentedFragment {
                     SubscriptionManager.getPhoneId(mSubId)).factoryReset();
            restoreDefaultApn(context);
            esimFactoryReset(context, context.getPackageName());
            // There has been issues when Sms raw table somehow stores orphan
            // fragments. They lead to garbled message when new fragments come
            // in and combied with those stale ones. In case this happens again,
            // user can reset all network settings which will clean up this table.
            cleanUpSmsRawTable(context);
        }
    };

    private void cleanUpSmsRawTable(Context context) {
        ContentResolver resolver = context.getContentResolver();
        Uri uri = Uri.withAppendedPath(Telephony.Sms.CONTENT_URI, "raw/permanentDelete");
        resolver.delete(uri, null, null);
    }

    @VisibleForTesting
    void esimFactoryReset(Context context, String packageName) {
        if (mEraseEsim) {