Merge "Clean Sms raw table when resetting network." into pi-dev am: 1340c3283c
am: 5227b14762
Change-Id: If945c6118066819cce988bc448c04095cb7f0e93
This commit is contained in:
@@ -32,9 +32,11 @@ import android.os.Bundle;
|
|||||||
import android.os.RecoverySystem;
|
import android.os.RecoverySystem;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
|
import android.provider.Telephony;
|
||||||
import android.support.annotation.VisibleForTesting;
|
import android.support.annotation.VisibleForTesting;
|
||||||
import android.telephony.SubscriptionManager;
|
import android.telephony.SubscriptionManager;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -151,9 +153,20 @@ public class ResetNetworkConfirm extends InstrumentedFragment {
|
|||||||
ImsManager.factoryReset(context);
|
ImsManager.factoryReset(context);
|
||||||
restoreDefaultApn(context);
|
restoreDefaultApn(context);
|
||||||
esimFactoryReset(context, context.getPackageName());
|
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
|
@VisibleForTesting
|
||||||
void esimFactoryReset(Context context, String packageName) {
|
void esimFactoryReset(Context context, String packageName) {
|
||||||
if (mEraseEsim) {
|
if (mEraseEsim) {
|
||||||
|
Reference in New Issue
Block a user