summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jaikumar Ganesh <jaikumar@google.com> 2010-09-10 15:54:19 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2010-09-10 15:54:19 -0700
commite442fb6c9215fc6329522915805a9582ec2c3323 (patch)
tree21c927256cde655e9ab5529d65a8d3751e6f9c30
parente262ab2f797eeaf9ad200a1b8479f67641c2aebb (diff)
parentd028bd0a5f485ee44d798a7aaf42639e52d2aa36 (diff)
Merge "Register ServiceStateChanged to CallManager." into gingerbread
-rw-r--r--telephony/java/com/android/internal/telephony/CallManager.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/telephony/java/com/android/internal/telephony/CallManager.java b/telephony/java/com/android/internal/telephony/CallManager.java
index caec7e1da592..4bf32829e761 100644
--- a/telephony/java/com/android/internal/telephony/CallManager.java
+++ b/telephony/java/com/android/internal/telephony/CallManager.java
@@ -74,6 +74,7 @@ public final class CallManager {
private static final int EVENT_ECM_TIMER_RESET = 115;
private static final int EVENT_SUBSCRIPTION_INFO_READY = 116;
private static final int EVENT_SUPP_SERVICE_FAILED = 117;
+ private static final int EVENT_SERVICE_STATE_CHANGED = 118;
// Singleton instance
private static final CallManager INSTANCE = new CallManager();
@@ -109,9 +110,6 @@ public final class CallManager {
protected final RegistrantList mDisconnectRegistrants
= new RegistrantList();
- protected final RegistrantList mServiceStateRegistrants
- = new RegistrantList();
-
protected final RegistrantList mMmiRegistrants
= new RegistrantList();
@@ -157,6 +155,9 @@ public final class CallManager {
protected final RegistrantList mSuppServiceFailedRegistrants
= new RegistrantList();
+ protected final RegistrantList mServiceStateChangedRegistrants
+ = new RegistrantList();
+
private CallManager() {
mPhones = new ArrayList<Phone>();
mRingingCalls = new ArrayList<Call>();
@@ -351,6 +352,7 @@ public final class CallManager {
phone.registerForEcmTimerReset(mHandler, EVENT_ECM_TIMER_RESET, null);
phone.registerForSubscriptionInfoReady(mHandler, EVENT_SUBSCRIPTION_INFO_READY, null);
phone.registerForSuppServiceFailed(mHandler, EVENT_SUPP_SERVICE_FAILED, null);
+ phone.registerForServiceStateChanged(mHandler, EVENT_SERVICE_STATE_CHANGED, null);
}
private void unregisterForPhoneStates(Phone phone) {
@@ -372,6 +374,7 @@ public final class CallManager {
phone.unregisterForEcmTimerReset(mHandler);
phone.unregisterForSubscriptionInfoReady(mHandler);
phone.unregisterForSuppServiceFailed(mHandler);
+ phone.unregisterForServiceStateChanged(mHandler);
}
/**
@@ -951,13 +954,17 @@ public final class CallManager {
* Message.obj will contain an AsyncResult.
* AsyncResult.result will be a ServiceState instance
*/
- public void registerForServiceStateChanged(Handler h, int what, Object obj){}
+ public void registerForServiceStateChanged(Handler h, int what, Object obj){
+ mServiceStateChangedRegistrants.addUnique(h, what, obj);
+ }
/**
* Unregisters for ServiceStateChange notification.
* Extraneous calls are tolerated silently
*/
- public void unregisterForServiceStateChanged(Handler h){}
+ public void unregisterForServiceStateChanged(Handler h){
+ mServiceStateChangedRegistrants.remove(h);
+ }
/**
* Register for notifications when a supplementary service attempt fails.
@@ -1399,6 +1406,8 @@ public final class CallManager {
case EVENT_SUPP_SERVICE_FAILED:
mSuppServiceFailedRegistrants.notifyRegistrants((AsyncResult) msg.obj);
break;
+ case EVENT_SERVICE_STATE_CHANGED:
+ mServiceStateChangedRegistrants.notifyRegistrants((AsyncResult) msg.obj);
}
}
};