[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
This commit is contained in:
Bonian Chen
2019-12-09 13:39:27 +08:00
parent efa2229556
commit 8a512ca7b4

View File

@@ -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));