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

Commit b7870c52 authored by Qiang Chen's avatar Qiang Chen Committed by Steve Kondik
Browse files

Keyguard: Avoid null pointer exception

Modify the parameter type to avoid null pointer exception

CRs-fixed: 768889

Change-Id: Ibef4ffd585a0aaf7f40b500f9640cab155d7739e
parent a817ee63
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;

@@ -457,9 +458,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));
            } else if (Intent.ACTION_LOCALE_CHANGED.equals(action)) {
                Log.d(TAG, "Received CONFIGURATION_CHANGED intent");
@@ -1070,14 +1070,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));
        }
    }