From 0d7d180246d4a963f1f7a75aa8aba4b288df77e7 Mon Sep 17 00:00:00 2001 From: songferngwang Date: Mon, 4 Mar 2024 10:05:53 +0000 Subject: [PATCH 1/2] Add the log for SidecarFragment The system miss the SidecarFragment result, so the settings did not active the esim. Bug: 302505660 Test: NA Change-Id: I746812220fed001eddc7d4aeeaf7aa0b04b86692 --- src/com/android/settings/network/SwitchSlotSidecar.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/android/settings/network/SwitchSlotSidecar.java b/src/com/android/settings/network/SwitchSlotSidecar.java index 7005452581e..72ece04b07f 100644 --- a/src/com/android/settings/network/SwitchSlotSidecar.java +++ b/src/com/android/settings/network/SwitchSlotSidecar.java @@ -130,11 +130,13 @@ public class SwitchSlotSidecar } catch (UiccSlotsException e) { result.exception = e; } + Log.i(TAG, "return command."); return result; } @Override protected void onPostExecute(Result result) { + Log.i(TAG, "onPostExecute: get result"); if (result.exception == null) { setState(State.SUCCESS, Substate.UNUSED); } else { From c9a3eeb7928ed5b80c8ceb68ec7f0f3c79d662cc Mon Sep 17 00:00:00 2001 From: songferngwang Date: Mon, 4 Mar 2024 10:58:22 +0000 Subject: [PATCH 2/2] Fix the testcase failed Add mock for SubscriptionManager.createForAllUserProfiles Bug: 323652989 Test: atest MobileNetworkPreferenceControllerTest Change-Id: I96574a79eba581db95d387f0d9c9fde2e004c41c --- .../settings/network/MobileNetworkPreferenceControllerTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/src/com/android/settings/network/MobileNetworkPreferenceControllerTest.java b/tests/unit/src/com/android/settings/network/MobileNetworkPreferenceControllerTest.java index be3815d78c9..1231c01b749 100644 --- a/tests/unit/src/com/android/settings/network/MobileNetworkPreferenceControllerTest.java +++ b/tests/unit/src/com/android/settings/network/MobileNetworkPreferenceControllerTest.java @@ -78,6 +78,7 @@ public class MobileNetworkPreferenceControllerTest { mContext = spy(ApplicationProvider.getApplicationContext()); when(mContext.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn(mTelephonyManager); when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager); + when(mSubscriptionManager.createForAllUserProfiles()).thenReturn(mSubscriptionManager); when(mContext.getSystemService(UserManager.class)).thenReturn(mUserManager); if (Looper.myLooper() == null) { Looper.prepare();