Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c03505e7 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Keyguard: Avoid null pointer exception"

parents 6f35d9fa e97fa112
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ import android.telephony.SubscriptionManager;
import android.telephony.SubInfoRecord;
import android.telephony.ServiceState;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseBooleanArray;

@@ -461,9 +462,8 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
            } else if (TelephonyIntents.ACTION_SERVICE_STATE_CHANGED.equals(action)) {
                long subId = intent.getLongExtra(PhoneConstants.SUBSCRIPTION_KEY, INVALID_SUBID);
                mServiceState.put(subId, ServiceState.newFromBundle(intent.getExtras()));
                Log.d(TAG, "ACTION_SERVICE_STATE_CHANGED on sub: " + subId + " showSpn:" +
                        mShowSpn.get(subId) + " showPlmn:" + mShowPlmn.get(subId) +
                        " mServiceState: " + mServiceState.get(subId));
                Log.d(TAG, "ACTION_SERVICE_STATE_CHANGED on sub: " + subId + " mServiceState: "
                        + mServiceState.get(subId));
                mHandler.sendMessage(mHandler.obtainMessage(MSG_CARRIER_INFO_UPDATE, subId));

                final Message message = mHandler.obtainMessage(
@@ -1079,14 +1079,14 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
        }
    }

    private void concatenate(boolean showSpn, boolean showPlmn, long subId,
    private void concatenate(Boolean showSpn, Boolean showPlmn, long subId,
            ServiceState state) {
        int phoneId = SubscriptionManager.getPhoneId(subId);
        String rat = getRadioTech(state, phoneId);
        if (showSpn) {
        if (Boolean.TRUE.equals(showSpn) && !TextUtils.isEmpty(mSpn.get(subId))) {
            mSpn.put(subId, new StringBuilder().append(mSpn.get(subId)).append(rat));
        }
        if (showPlmn) {
        if (Boolean.TRUE.equals(showPlmn) && !TextUtils.isEmpty(mPlmn.get(subId))) {
            mPlmn.put(subId, new StringBuilder().append(mPlmn.get(subId)).append(rat));
        }
    }