From 61e159504a49cd283fea1658beaa758a3d3e0a99 Mon Sep 17 00:00:00 2001 From: John Wang Date: Wed, 21 Sep 2011 10:54:35 -0700 Subject: 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 --- .../com/android/internal/policy/impl/KeyguardUpdateMonitor.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'policy/src/com/android/internal') diff --git a/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java b/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java index 958f555..2a23709 100644 --- a/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java +++ b/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java @@ -484,6 +484,9 @@ public class KeyguardUpdateMonitor { public void registerInfoCallback(InfoCallback callback) { if (!mInfoCallbacks.contains(callback)) { mInfoCallbacks.add(callback); + // notify the register the current state right away + // TODO: need call other callback methods + callback.onRefreshCarrierInfo(mTelephonyPlmn, mTelephonySpn); } else { if (DEBUG) Log.e(TAG, "Object tried to add another INFO callback", new Exception("Whoops")); @@ -497,6 +500,10 @@ public class KeyguardUpdateMonitor { public void registerSimStateCallback(SimStateCallback callback) { if (!mSimStateCallbacks.contains(callback)) { mSimStateCallbacks.add(callback); + // notify the register the current sim state right away, + // otherwise the register won't receive any state until + // sim state gets changed again. + callback.onSimStateChanged(mSimState); } else { if (DEBUG) Log.e(TAG, "Object tried to add another SIM callback", new Exception("Whoops")); -- cgit v1.1