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

Commit b50cdc4a authored by Umashankar Godachi's avatar Umashankar Godachi Committed by Ravindra
Browse files

Fix null pointer exception in KeyguardUpdateMonitor.

While handling the message 'carrier info update' in
KeyguardUpdateMonitor, there is a possibility of crash
when subscription id queried for returns null.
Add null check to avoid the NullPointerException.

Change-Id: I1a27f60c42a675b84aba9b1301f8155cf9586120
CRs-Fixed: 769954
parent 4745900c
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -464,8 +464,13 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
            } else if (Intent.ACTION_LOCALE_CHANGED.equals(action)) {
                Log.d(TAG, "Received CONFIGURATION_CHANGED intent");
                for (int i = 0; i < mNumPhones; i++) {
                    long subId = SubscriptionManager.getSubId(i)[0];
                    mHandler.sendMessage(mHandler.obtainMessage(MSG_CARRIER_INFO_UPDATE, subId));
                    long[] subIds = SubscriptionManager.getSubId(i);
                    if (subIds != null && subIds.length > 0) {
                        mHandler.sendMessage(mHandler.obtainMessage(MSG_CARRIER_INFO_UPDATE,
                                subIds[0]));
                    } else {
                        Log.d(TAG, "No valid subs");
                    }
                }
            }