Reset telephony stack during Reset Mobile Network flow

This CL introduces two more steps to restart Phone process and RILD
during the Reset mobile network flow by the help of the
TelephonyContentProvider which has been used by Pixel Adaptive
Connectivity Services ("SCONE") for a while.

The additional reset options can resolve issues like resources leak
and internal state stuck, effectively recover telephony stack into
fresh state.

The reset options are performed in the background and have no impact
on UX of the reset flow.

Bug: 271921464
Test: ResetNetworkOperationBuilderTest
Test: Feature test with both flag on and off
Change-Id: If09d20d79e908dd43f3f654fb7cca7f713b7f03a
This commit is contained in:
Rambo Wang
2024-01-04 04:33:23 +00:00
parent 4f06db7bf8
commit 4c384506d5
6 changed files with 126 additions and 1 deletions

View File

@@ -21,7 +21,6 @@ import android.app.Activity;
import android.app.settings.SettingsEnums;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.provider.Settings;
@@ -128,6 +127,8 @@ public class ResetNetwork extends InstrumentedFragment {
| ResetNetworkRequest.RESET_VPN_MANAGER;
if (Flags.resetMobileNetworkSettings()) {
resetOptions |= ResetNetworkRequest.RESET_IMS_STACK;
resetOptions |= ResetNetworkRequest.RESET_PHONE_PROCESS;
resetOptions |= ResetNetworkRequest.RESET_RILD;
}
ResetNetworkRequest request = new ResetNetworkRequest(resetOptions);
if (mSubscriptions != null && mSubscriptions.size() > 0) {