diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2011-05-09 17:02:28 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-05-09 17:02:28 -0700 |
commit | 9dd0cb89771adbe50fe0cf079280c29964f0971a (patch) | |
tree | 4d1a468f34319de1fa59bfa84c69c5f22b4e25b7 | |
parent | b109c8877139077fe25fa26ea2e0961b7cbb8341 (diff) | |
parent | b98b56c21faac16cea97e8cdcba485365f86c50f (diff) | |
download | frameworks_base-9dd0cb89771adbe50fe0cf079280c29964f0971a.zip frameworks_base-9dd0cb89771adbe50fe0cf079280c29964f0971a.tar.gz frameworks_base-9dd0cb89771adbe50fe0cf079280c29964f0971a.tar.bz2 |
am b98b56c2: am a142512a: Broadcast SIM Refresh to all registered components
* commit 'b98b56c21faac16cea97e8cdcba485365f86c50f':
Broadcast SIM Refresh to all registered components
5 files changed, 14 insertions, 14 deletions
diff --git a/telephony/java/com/android/internal/telephony/BaseCommands.java b/telephony/java/com/android/internal/telephony/BaseCommands.java index ec04fa8..27ff656 100644 --- a/telephony/java/com/android/internal/telephony/BaseCommands.java +++ b/telephony/java/com/android/internal/telephony/BaseCommands.java @@ -71,6 +71,7 @@ public abstract class BaseCommands implements CommandsInterface { protected RegistrantList mCdmaPrlChangedRegistrants = new RegistrantList(); protected RegistrantList mExitEmergencyCallbackModeRegistrants = new RegistrantList(); protected RegistrantList mRilConnectedRegistrants = new RegistrantList(); + protected RegistrantList mIccRefreshRegistrants = new RegistrantList(); protected Registrant mSMSRegistrant; protected Registrant mNITZTimeRegistrant; @@ -85,7 +86,6 @@ public abstract class BaseCommands implements CommandsInterface { protected Registrant mCatCallSetUpRegistrant; protected Registrant mIccSmsFullRegistrant; protected Registrant mEmergencyCallbackModeRegistrant; - protected Registrant mIccRefreshRegistrant; protected Registrant mRingRegistrant; protected Registrant mRestrictedStateRegistrant; protected Registrant mGsmBroadcastSmsRegistrant; @@ -454,16 +454,17 @@ public abstract class BaseCommands implements CommandsInterface { mIccSmsFullRegistrant.clear(); } - public void setOnIccRefresh(Handler h, int what, Object obj) { - mIccRefreshRegistrant = new Registrant (h, what, obj); + public void registerForIccRefresh(Handler h, int what, Object obj) { + Registrant r = new Registrant (h, what, obj); + mIccRefreshRegistrants.add(r); } public void setEmergencyCallbackMode(Handler h, int what, Object obj) { mEmergencyCallbackModeRegistrant = new Registrant (h, what, obj); } - public void unSetOnIccRefresh(Handler h) { - mIccRefreshRegistrant.clear(); + public void unregisterForIccRefresh(Handler h) { + mIccRefreshRegistrants.remove(h); } public void setOnCallRing(Handler h, int what, Object obj) { diff --git a/telephony/java/com/android/internal/telephony/CommandsInterface.java b/telephony/java/com/android/internal/telephony/CommandsInterface.java index 1d574ca..f87d188 100644 --- a/telephony/java/com/android/internal/telephony/CommandsInterface.java +++ b/telephony/java/com/android/internal/telephony/CommandsInterface.java @@ -352,14 +352,13 @@ public interface CommandsInterface { /** * Sets the handler for SIM Refresh notifications. - * Unlike the register* methods, there's only one notification handler * * @param h Handler for notification message. * @param what User-defined message code. * @param obj User object. */ - void setOnIccRefresh(Handler h, int what, Object obj); - void unSetOnIccRefresh(Handler h); + void registerForIccRefresh(Handler h, int what, Object obj); + void unregisterForIccRefresh(Handler h); /** * Sets the handler for RING notifications. diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java index 490051d..d1c6b29 100644 --- a/telephony/java/com/android/internal/telephony/RIL.java +++ b/telephony/java/com/android/internal/telephony/RIL.java @@ -2601,8 +2601,8 @@ public final class RIL extends BaseCommands implements CommandsInterface { case RIL_UNSOL_SIM_REFRESH: if (RILJ_LOGD) unsljLogRet(response, ret); - if (mIccRefreshRegistrant != null) { - mIccRefreshRegistrant.notifyRegistrant( + if (mIccRefreshRegistrants != null) { + mIccRefreshRegistrants.notifyRegistrants( new AsyncResult (null, ret, null)); } break; diff --git a/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java b/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java index 3429099..ab664d2 100755 --- a/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java +++ b/telephony/java/com/android/internal/telephony/cdma/RuimRecords.java @@ -91,7 +91,7 @@ public final class RuimRecords extends IccRecords { p.mCM.registerForRUIMReady(this, EVENT_RUIM_READY, null); p.mCM.registerForOffOrNotAvailable(this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null); // NOTE the EVENT_SMS_ON_RUIM is not registered - p.mCM.setOnIccRefresh(this, EVENT_RUIM_REFRESH, null); + p.mCM.registerForIccRefresh(this, EVENT_RUIM_REFRESH, null); // Start off by setting empty state onRadioOffOrNotAvailable(); @@ -102,7 +102,7 @@ public final class RuimRecords extends IccRecords { //Unregister for all events phone.mCM.unregisterForRUIMReady(this); phone.mCM.unregisterForOffOrNotAvailable( this); - phone.mCM.unSetOnIccRefresh(this); + phone.mCM.unregisterForIccRefresh(this); } @Override diff --git a/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java b/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java index 8b032ff..7fb250f 100755 --- a/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java +++ b/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java @@ -184,7 +184,7 @@ public final class SIMRecords extends IccRecords { p.mCM.registerForOffOrNotAvailable( this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null); p.mCM.setOnSmsOnSim(this, EVENT_SMS_ON_SIM, null); - p.mCM.setOnIccRefresh(this, EVENT_SIM_REFRESH, null); + p.mCM.registerForIccRefresh(this, EVENT_SIM_REFRESH, null); // Start off by setting empty state onRadioOffOrNotAvailable(); @@ -195,7 +195,7 @@ public final class SIMRecords extends IccRecords { //Unregister for all events phone.mCM.unregisterForSIMReady(this); phone.mCM.unregisterForOffOrNotAvailable( this); - phone.mCM.unSetOnIccRefresh(this); + phone.mCM.unregisterForIccRefresh(this); } protected void finalize() { |