Skip to content

Commit 61e1595

Browse files
author
John Wang
committed
Notify the sim state after callback registration.
Notify the register the current sim state right away in registerSimStateCallback.Otherwise the register won't receive any state until sim state gets changed again. That will introduce a racing condition. If the sim state changes to PUK_LOCKED after registering the callback, the PUK unlock screen shows up. If the sim state changes to PUK_LOCKED before registering, the PUK unlock screen won't show. bug:5243771 Change-Id: I27de1329a30adba68952cf086d2130c4cef54270
1 parent 79a33ad commit 61e1595

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,9 @@ interface SimStateCallback {
484484
public void registerInfoCallback(InfoCallback callback) {
485485
if (!mInfoCallbacks.contains(callback)) {
486486
mInfoCallbacks.add(callback);
487+
// notify the register the current state right away
488+
// TODO: need call other callback methods
489+
callback.onRefreshCarrierInfo(mTelephonyPlmn, mTelephonySpn);
487490
} else {
488491
if (DEBUG) Log.e(TAG, "Object tried to add another INFO callback",
489492
new Exception("Whoops"));
@@ -497,6 +500,10 @@ public void registerInfoCallback(InfoCallback callback) {
497500
public void registerSimStateCallback(SimStateCallback callback) {
498501
if (!mSimStateCallbacks.contains(callback)) {
499502
mSimStateCallbacks.add(callback);
503+
// notify the register the current sim state right away,
504+
// otherwise the register won't receive any state until
505+
// sim state gets changed again.
506+
callback.onSimStateChanged(mSimState);
500507
} else {
501508
if (DEBUG) Log.e(TAG, "Object tried to add another SIM callback",
502509
new Exception("Whoops"));

0 commit comments

Comments
 (0)