From 8a512ca7b4f99415244d6068f5e2362303e956ff Mon Sep 17 00:00:00 2001 From: Bonian Chen Date: Mon, 9 Dec 2019 13:39:27 +0800 Subject: [PATCH] [Settings] Fix crash when no SIM Airplane mode enabler exception under the condition of no active subscription. This is due to incorrect null pointer checking within source code. Bug: 145830780 Test: manual Change-Id: I47cb4d82b7b99b4c34270023cd58f479347477da --- src/com/android/settings/AirplaneModeEnabler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/AirplaneModeEnabler.java b/src/com/android/settings/AirplaneModeEnabler.java index c6ab58e1039..64ad17d0abe 100644 --- a/src/com/android/settings/AirplaneModeEnabler.java +++ b/src/com/android/settings/AirplaneModeEnabler.java @@ -97,7 +97,7 @@ public class AirplaneModeEnabler extends GlobalSettingsChangeListener { mServiceStateListeners.add(new ServiceStateListener(mTelephonyManager, SubscriptionManager.INVALID_SUBSCRIPTION_ID, this)); - if (subInfoList == null) { + if (subInfoList != null) { for (SubscriptionInfo subInfo : subInfoList) { mServiceStateListeners.add(new ServiceStateListener(mTelephonyManager, subInfo.getSubscriptionId(), this));