From ce8232d0a4e3c243f52b8fb855f4a6fd35b8287f Mon Sep 17 00:00:00 2001 From: SongFerngWang Date: Tue, 1 Mar 2022 15:46:28 +0800 Subject: [PATCH] [MEP] The condition of "null point check" is wrong The condition of "null point check" is wrong at the SimSlotChangeHandler. Bug: 222035986 Test: Build pass. maunal test. Change-Id: I1b81faf082163643c1d17eae2f66d75b450288fe (cherry picked from commit f64b2c09c0d0e05c96ca5e973076ba53e1674984) --- .../settings/sim/receivers/SimSlotChangeHandler.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/sim/receivers/SimSlotChangeHandler.java b/src/com/android/settings/sim/receivers/SimSlotChangeHandler.java index 61241d01a56..4a6b96c1fa3 100644 --- a/src/com/android/settings/sim/receivers/SimSlotChangeHandler.java +++ b/src/com/android/settings/sim/receivers/SimSlotChangeHandler.java @@ -258,10 +258,11 @@ public class SimSlotChangeHandler { } List subscriptionInfos = getAvailableRemovableSubscription(); - if (subscriptionInfos == null && subscriptionInfos.get(0) != null) { + if (subscriptionInfos == null || subscriptionInfos.get(0) == null) { Log.e(TAG, "Unable to find the removable subscriptionInfo. Do nothing."); return; } + Log.d(TAG, "getAvailableRemovableSubscription:" + subscriptionInfos); startSimConfirmDialogActivity(subscriptionInfos.get(0).getSubscriptionId()); } @@ -364,6 +365,7 @@ public class SimSlotChangeHandler { Log.i(TAG, "Unable to enable subscription due to invalid subscription ID."); return; } + Log.d(TAG, "Start ToggleSubscriptionDialogActivity with " + subId + " under DSDS+Mep."); Intent intent = ToggleSubscriptionDialogActivity.getIntent(mContext, subId, true); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); mContext.startActivity(intent); @@ -372,7 +374,7 @@ public class SimSlotChangeHandler { private boolean isMultipleEnabledProfilesSupported() { List cardInfos = mTelMgr.getUiccCardsInfo(); if (cardInfos == null) { - Log.w(TAG, "UICC cards info list is empty."); + Log.d(TAG, "UICC cards info list is empty."); return false; } return cardInfos.stream().anyMatch(