Move SMS raw db deletion to phone process.

Test: manual
Bug: 127929687
Change-Id: Ib23efc647fbd4b3007197932b9493393dc5b4d5b
This commit is contained in:
Amit Mahajan
2019-03-13 17:32:39 -07:00
parent 50a39ba9a9
commit d0ff80dc79

View File

@@ -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) {