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

Commit 3311859a authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Fix NPE when removing PIN locked SIM during E911 call

There is the possibility of mCallback being null while
the Keyguard still has a PhoneStateListener registered
for onSimStateChanged callback. This can cause a NPE.

Bug: 66986066
Test: Manual, PIN/PUK locked SIM
Merged-In: Id8ca403a839cff994970c370973a91e8e5688722
Change-Id: I799c9521f787e800e259c3bdce9edee3f844f5f3
parent d81e99a9
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -66,7 +66,11 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
                // again when the PUK locked SIM is re-entered.
                case ABSENT: {
                    KeyguardUpdateMonitor.getInstance(getContext()).reportSimUnlocked(mSubId);
                    // onSimStateChanged callback can fire when the SIM PIN lock is not currently
                    // active and mCallback is null.
                    if (mCallback != null) {
                        mCallback.dismiss(true, KeyguardUpdateMonitor.getCurrentUser());
                    }
                    break;
                }
                default:
+5 −1
Original line number Diff line number Diff line
@@ -72,7 +72,11 @@ public class KeyguardSimPukView extends KeyguardPinBasedInputView {
                // move into the READY state and the PUK lock keyguard should be removed.
                case READY: {
                    KeyguardUpdateMonitor.getInstance(getContext()).reportSimUnlocked(mSubId);
                    // mCallback can be null if onSimStateChanged callback is called when keyguard
                    // isn't active.
                    if (mCallback != null) {
                        mCallback.dismiss(true, KeyguardUpdateMonitor.getCurrentUser());
                    }
                    break;
                }
                default: