am a142512a: Broadcast SIM Refresh to all registered components

* commit 'a142512a5009d7b4c422d23b1d7bab8d219eb50b':
  Broadcast SIM Refresh to all registered components
This commit is contained in:
Robert Greenwalt
2011-05-09 16:58:52 -07:00
committed by Android Git Automerger
5 changed files with 14 additions and 14 deletions

View File

@@ -72,6 +72,7 @@ public abstract class BaseCommands implements CommandsInterface {
protected RegistrantList mCdmaPrlChangedRegistrants = new RegistrantList(); protected RegistrantList mCdmaPrlChangedRegistrants = new RegistrantList();
protected RegistrantList mExitEmergencyCallbackModeRegistrants = new RegistrantList(); protected RegistrantList mExitEmergencyCallbackModeRegistrants = new RegistrantList();
protected RegistrantList mRilConnectedRegistrants = new RegistrantList(); protected RegistrantList mRilConnectedRegistrants = new RegistrantList();
protected RegistrantList mIccRefreshRegistrants = new RegistrantList();
protected Registrant mSMSRegistrant; protected Registrant mSMSRegistrant;
protected Registrant mNITZTimeRegistrant; protected Registrant mNITZTimeRegistrant;
@@ -86,7 +87,6 @@ public abstract class BaseCommands implements CommandsInterface {
protected Registrant mCatCallSetUpRegistrant; protected Registrant mCatCallSetUpRegistrant;
protected Registrant mIccSmsFullRegistrant; protected Registrant mIccSmsFullRegistrant;
protected Registrant mEmergencyCallbackModeRegistrant; protected Registrant mEmergencyCallbackModeRegistrant;
protected Registrant mIccRefreshRegistrant;
protected Registrant mRingRegistrant; protected Registrant mRingRegistrant;
protected Registrant mRestrictedStateRegistrant; protected Registrant mRestrictedStateRegistrant;
protected Registrant mGsmBroadcastSmsRegistrant; protected Registrant mGsmBroadcastSmsRegistrant;
@@ -455,16 +455,17 @@ public abstract class BaseCommands implements CommandsInterface {
mIccSmsFullRegistrant.clear(); mIccSmsFullRegistrant.clear();
} }
public void setOnIccRefresh(Handler h, int what, Object obj) { public void registerForIccRefresh(Handler h, int what, Object obj) {
mIccRefreshRegistrant = new Registrant (h, what, obj); Registrant r = new Registrant (h, what, obj);
mIccRefreshRegistrants.add(r);
} }
public void setEmergencyCallbackMode(Handler h, int what, Object obj) { public void setEmergencyCallbackMode(Handler h, int what, Object obj) {
mEmergencyCallbackModeRegistrant = new Registrant (h, what, obj); mEmergencyCallbackModeRegistrant = new Registrant (h, what, obj);
} }
public void unSetOnIccRefresh(Handler h) { public void unregisterForIccRefresh(Handler h) {
mIccRefreshRegistrant.clear(); mIccRefreshRegistrants.remove(h);
} }
public void setOnCallRing(Handler h, int what, Object obj) { public void setOnCallRing(Handler h, int what, Object obj) {

View File

@@ -352,14 +352,13 @@ public interface CommandsInterface {
/** /**
* Sets the handler for SIM Refresh notifications. * Sets the handler for SIM Refresh notifications.
* Unlike the register* methods, there's only one notification handler
* *
* @param h Handler for notification message. * @param h Handler for notification message.
* @param what User-defined message code. * @param what User-defined message code.
* @param obj User object. * @param obj User object.
*/ */
void setOnIccRefresh(Handler h, int what, Object obj); void registerForIccRefresh(Handler h, int what, Object obj);
void unSetOnIccRefresh(Handler h); void unregisterForIccRefresh(Handler h);
/** /**
* Sets the handler for RING notifications. * Sets the handler for RING notifications.

View File

@@ -2602,8 +2602,8 @@ public final class RIL extends BaseCommands implements CommandsInterface {
case RIL_UNSOL_SIM_REFRESH: case RIL_UNSOL_SIM_REFRESH:
if (RILJ_LOGD) unsljLogRet(response, ret); if (RILJ_LOGD) unsljLogRet(response, ret);
if (mIccRefreshRegistrant != null) { if (mIccRefreshRegistrants != null) {
mIccRefreshRegistrant.notifyRegistrant( mIccRefreshRegistrants.notifyRegistrants(
new AsyncResult (null, ret, null)); new AsyncResult (null, ret, null));
} }
break; break;

View File

@@ -91,7 +91,7 @@ public final class RuimRecords extends IccRecords {
p.mCM.registerForRUIMReady(this, EVENT_RUIM_READY, null); p.mCM.registerForRUIMReady(this, EVENT_RUIM_READY, null);
p.mCM.registerForOffOrNotAvailable(this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null); p.mCM.registerForOffOrNotAvailable(this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null);
// NOTE the EVENT_SMS_ON_RUIM is not registered // 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 // Start off by setting empty state
onRadioOffOrNotAvailable(); onRadioOffOrNotAvailable();
@@ -102,7 +102,7 @@ public final class RuimRecords extends IccRecords {
//Unregister for all events //Unregister for all events
phone.mCM.unregisterForRUIMReady(this); phone.mCM.unregisterForRUIMReady(this);
phone.mCM.unregisterForOffOrNotAvailable( this); phone.mCM.unregisterForOffOrNotAvailable( this);
phone.mCM.unSetOnIccRefresh(this); phone.mCM.unregisterForIccRefresh(this);
} }
@Override @Override

View File

@@ -184,7 +184,7 @@ public final class SIMRecords extends IccRecords {
p.mCM.registerForOffOrNotAvailable( p.mCM.registerForOffOrNotAvailable(
this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null); this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null);
p.mCM.setOnSmsOnSim(this, EVENT_SMS_ON_SIM, 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 // Start off by setting empty state
onRadioOffOrNotAvailable(); onRadioOffOrNotAvailable();
@@ -195,7 +195,7 @@ public final class SIMRecords extends IccRecords {
//Unregister for all events //Unregister for all events
phone.mCM.unregisterForSIMReady(this); phone.mCM.unregisterForSIMReady(this);
phone.mCM.unregisterForOffOrNotAvailable( this); phone.mCM.unregisterForOffOrNotAvailable( this);
phone.mCM.unSetOnIccRefresh(this); phone.mCM.unregisterForIccRefresh(this);
} }
protected void finalize() { protected void finalize() {