Loading src/com/android/settings/ResetNetworkRequest.java +1 −0 Original line number Diff line number Diff line Loading @@ -270,6 +270,7 @@ public class ResetNetworkRequest { if ((mResetOptions & RESET_IMS_STACK) != 0) { builder.resetIms(mSubscriptionIdToResetIms); } // Reset phone process and RILD may impact above components, keep them at the end if ((mResetOptions & RESET_PHONE_PROCESS) != 0) { builder.restartPhoneProcess(); } Loading src/com/android/settings/network/ResetNetworkOperationBuilder.java +26 −20 Original line number Diff line number Diff line Loading @@ -256,6 +256,7 @@ public class ResetNetworkOperationBuilder { * @return this */ public ResetNetworkOperationBuilder restartPhoneProcess() { Runnable runnable = () -> { try { mContext.getContentResolver().call( getResetTelephonyContentProviderAuthority(), Loading @@ -266,6 +267,8 @@ public class ResetNetworkOperationBuilder { } catch (IllegalArgumentException iae) { Log.w(TAG, "Fail to restart phone process: " + iae); } }; mResetSequence.add(runnable); return this; } Loading @@ -275,6 +278,7 @@ public class ResetNetworkOperationBuilder { * @return this */ public ResetNetworkOperationBuilder restartRild() { Runnable runnable = () -> { try { mContext.getContentResolver().call( getResetTelephonyContentProviderAuthority(), Loading @@ -285,6 +289,8 @@ public class ResetNetworkOperationBuilder { } catch (IllegalArgumentException iae) { Log.w(TAG, "Fail to restart RILD: " + iae); } }; mResetSequence.add(runnable); return this; } Loading tests/unit/src/com/android/settings/network/ResetNetworkOperationBuilderTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ public class ResetNetworkOperationBuilderTest { doThrow(new IllegalArgumentException()).when(mContentProvider).call( anyString(), anyString(), anyString(), any()); mBuilder.restartPhoneProcess(); mBuilder.restartPhoneProcess().build().run(); } @Test Loading @@ -196,12 +196,12 @@ public class ResetNetworkOperationBuilderTest { doThrow(new IllegalArgumentException()).when(mContentProvider).call( anyString(), anyString(), anyString(), any()); mBuilder.restartRild(); mBuilder.restartRild().build().run(); } @Test public void restartPhoneProcess_withTelephonyContentProvider_shouldCallRestartPhoneProcess() { mBuilder.restartPhoneProcess(); mBuilder.restartPhoneProcess().build().run(); verify(mContentProvider).call( eq(mBuilder.getResetTelephonyContentProviderAuthority()), Loading @@ -212,7 +212,7 @@ public class ResetNetworkOperationBuilderTest { @Test public void restartRild_withTelephonyContentProvider_shouldCallRestartRild() { mBuilder.restartRild(); mBuilder.restartRild().build().run(); verify(mContentProvider).call( eq(mBuilder.getResetTelephonyContentProviderAuthority()), Loading Loading
src/com/android/settings/ResetNetworkRequest.java +1 −0 Original line number Diff line number Diff line Loading @@ -270,6 +270,7 @@ public class ResetNetworkRequest { if ((mResetOptions & RESET_IMS_STACK) != 0) { builder.resetIms(mSubscriptionIdToResetIms); } // Reset phone process and RILD may impact above components, keep them at the end if ((mResetOptions & RESET_PHONE_PROCESS) != 0) { builder.restartPhoneProcess(); } Loading
src/com/android/settings/network/ResetNetworkOperationBuilder.java +26 −20 Original line number Diff line number Diff line Loading @@ -256,6 +256,7 @@ public class ResetNetworkOperationBuilder { * @return this */ public ResetNetworkOperationBuilder restartPhoneProcess() { Runnable runnable = () -> { try { mContext.getContentResolver().call( getResetTelephonyContentProviderAuthority(), Loading @@ -266,6 +267,8 @@ public class ResetNetworkOperationBuilder { } catch (IllegalArgumentException iae) { Log.w(TAG, "Fail to restart phone process: " + iae); } }; mResetSequence.add(runnable); return this; } Loading @@ -275,6 +278,7 @@ public class ResetNetworkOperationBuilder { * @return this */ public ResetNetworkOperationBuilder restartRild() { Runnable runnable = () -> { try { mContext.getContentResolver().call( getResetTelephonyContentProviderAuthority(), Loading @@ -285,6 +289,8 @@ public class ResetNetworkOperationBuilder { } catch (IllegalArgumentException iae) { Log.w(TAG, "Fail to restart RILD: " + iae); } }; mResetSequence.add(runnable); return this; } Loading
tests/unit/src/com/android/settings/network/ResetNetworkOperationBuilderTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ public class ResetNetworkOperationBuilderTest { doThrow(new IllegalArgumentException()).when(mContentProvider).call( anyString(), anyString(), anyString(), any()); mBuilder.restartPhoneProcess(); mBuilder.restartPhoneProcess().build().run(); } @Test Loading @@ -196,12 +196,12 @@ public class ResetNetworkOperationBuilderTest { doThrow(new IllegalArgumentException()).when(mContentProvider).call( anyString(), anyString(), anyString(), any()); mBuilder.restartRild(); mBuilder.restartRild().build().run(); } @Test public void restartPhoneProcess_withTelephonyContentProvider_shouldCallRestartPhoneProcess() { mBuilder.restartPhoneProcess(); mBuilder.restartPhoneProcess().build().run(); verify(mContentProvider).call( eq(mBuilder.getResetTelephonyContentProviderAuthority()), Loading @@ -212,7 +212,7 @@ public class ResetNetworkOperationBuilderTest { @Test public void restartRild_withTelephonyContentProvider_shouldCallRestartRild() { mBuilder.restartRild(); mBuilder.restartRild().build().run(); verify(mContentProvider).call( eq(mBuilder.getResetTelephonyContentProviderAuthority()), Loading