diff options
author | John Wang <johnwang@google.com> | 2010-01-29 00:21:46 -0800 |
---|---|---|
committer | John Wang <johnwang@google.com> | 2010-01-29 20:04:39 -0800 |
commit | 1ccc41ed938ff005ae3d621292580a90601242ca (patch) | |
tree | af804284e0ad47d2a002e6737bc272f01cf69e05 | |
parent | 7b00a8ae71c5964cb96e1663b778658eaa069b3e (diff) | |
download | base-1ccc41ed938ff005ae3d621292580a90601242ca.tar.gz |
Handle RIL_UNSOL_RESEND_INCALL_MUTE.
For bug 2400052.
Notify registered handler whenever receiving RIL_UNSOL_RESEND_INCALL_MUTE.
7 files changed, 62 insertions, 0 deletions
diff --git a/telephony/java/com/android/internal/telephony/BaseCommands.java b/telephony/java/com/android/internal/telephony/BaseCommands.java index 7586ba29c435..74218547a300 100644 --- a/telephony/java/com/android/internal/telephony/BaseCommands.java +++ b/telephony/java/com/android/internal/telephony/BaseCommands.java @@ -65,6 +65,7 @@ public abstract class BaseCommands implements CommandsInterface { protected RegistrantList mT53ClirInfoRegistrants = new RegistrantList(); protected RegistrantList mT53AudCntrlInfoRegistrants = new RegistrantList(); protected RegistrantList mRingbackToneRegistrants = new RegistrantList(); + protected RegistrantList mResendIncallMuteRegistrants = new RegistrantList(); protected Registrant mSMSRegistrant; protected Registrant mNITZTimeRegistrant; @@ -579,6 +580,15 @@ public abstract class BaseCommands implements CommandsInterface { mRingbackToneRegistrants.remove(h); } + public void registerForResendIncallMute(Handler h, int what, Object obj) { + Registrant r = new Registrant (h, what, obj); + mResendIncallMuteRegistrants.add(r); + } + + public void unregisterForResendIncallMute(Handler h) { + mResendIncallMuteRegistrants.remove(h); + } + //***** Protected Methods /** * Store new RadioState and send notification based on the changes diff --git a/telephony/java/com/android/internal/telephony/CommandsInterface.java b/telephony/java/com/android/internal/telephony/CommandsInterface.java index 1d9f10a96e03..d90c3056bf76 100644 --- a/telephony/java/com/android/internal/telephony/CommandsInterface.java +++ b/telephony/java/com/android/internal/telephony/CommandsInterface.java @@ -537,6 +537,18 @@ public interface CommandsInterface { void registerForRingbackTone(Handler h, int what, Object obj); void unregisterForRingbackTone(Handler h); + /** + * Registers the handler when mute/unmute need to be resent to get + * uplink audio during a call.<p> + * + * @param h Handler for notification message. + * @param what User-defined message code. + * @param obj User object. + * + */ + void registerForResendIncallMute(Handler h, int what, Object obj); + void unregisterForResendIncallMute(Handler h); + /** * Supply the ICC PIN to the ICC card * diff --git a/telephony/java/com/android/internal/telephony/Phone.java b/telephony/java/com/android/internal/telephony/Phone.java index c1135817a22f..11386aeab440 100644 --- a/telephony/java/com/android/internal/telephony/Phone.java +++ b/telephony/java/com/android/internal/telephony/Phone.java @@ -407,6 +407,16 @@ public interface Phone { void unregisterForRingbackTone(Handler h); + /** + * Registers the handler to reset the uplink mute state to get + * uplink audio. + */ + void registerForResendIncallMute(Handler h, int what, Object obj); + + /** + * Unregisters for resend incall mute notifications. + */ + void unregisterForResendIncallMute(Handler h); /** * Notifies when a voice connection has disconnected, either due to local diff --git a/telephony/java/com/android/internal/telephony/PhoneBase.java b/telephony/java/com/android/internal/telephony/PhoneBase.java index 1c03c5a31c31..eb406b72da1c 100644 --- a/telephony/java/com/android/internal/telephony/PhoneBase.java +++ b/telephony/java/com/android/internal/telephony/PhoneBase.java @@ -492,6 +492,16 @@ public abstract class PhoneBase extends Handler implements Phone { mCM.unregisterForRingbackTone(h); } + // Inherited documentation suffices. + public void registerForResendIncallMute(Handler h, int what, Object obj) { + mCM.registerForResendIncallMute(h,what,obj); + } + + // Inherited documentation suffices. + public void unregisterForResendIncallMute(Handler h) { + mCM.unregisterForResendIncallMute(h); + } + /** * Subclasses of Phone probably want to replace this with a * version scoped to their packages diff --git a/telephony/java/com/android/internal/telephony/PhoneProxy.java b/telephony/java/com/android/internal/telephony/PhoneProxy.java index b1eaa9311563..1ef8d3744605 100644 --- a/telephony/java/com/android/internal/telephony/PhoneProxy.java +++ b/telephony/java/com/android/internal/telephony/PhoneProxy.java @@ -343,6 +343,14 @@ public class PhoneProxy extends Handler implements Phone { mActivePhone.unregisterForRingbackTone(h); } + public void registerForResendIncallMute(Handler h, int what, Object obj) { + mActivePhone.registerForResendIncallMute(h,what,obj); + } + + public void unregisterForResendIncallMute(Handler h) { + mActivePhone.unregisterForResendIncallMute(h); + } + public boolean getIccRecordsLoaded() { return mActivePhone.getIccRecordsLoaded(); } diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java index d802efa221cd..86cb6fb79e71 100644 --- a/telephony/java/com/android/internal/telephony/RIL.java +++ b/telephony/java/com/android/internal/telephony/RIL.java @@ -2323,6 +2323,7 @@ public final class RIL extends BaseCommands implements CommandsInterface { case RIL_UNSOL_CDMA_INFO_REC: ret = responseCdmaInformationRecord(p); break; case RIL_UNSOL_OEM_HOOK_RAW: ret = responseRaw(p); break; case RIL_UNSOL_RINGBACK_TONE: ret = responseInts(p); break; + case RIL_UNSOL_RESEND_INCALL_MUTE: ret = responseVoid(p); break; default: throw new RuntimeException("Unrecognized unsol response: " + response); @@ -2615,6 +2616,15 @@ public final class RIL extends BaseCommands implements CommandsInterface { mRingbackToneRegistrants.notifyRegistrants( new AsyncResult (null, playtone, null)); } + break; + + case RIL_UNSOL_RESEND_INCALL_MUTE: + if (RILJ_LOGD) unsljLogRet(response, ret); + + if (mResendIncallMuteRegistrants != null) { + mResendIncallMuteRegistrants.notifyRegistrants( + new AsyncResult (null, ret, null)); + } } } @@ -3251,6 +3261,7 @@ public final class RIL extends BaseCommands implements CommandsInterface { case RIL_UNSOL_CDMA_INFO_REC: return "UNSOL_CDMA_INFO_REC"; case RIL_UNSOL_OEM_HOOK_RAW: return "UNSOL_OEM_HOOK_RAW"; case RIL_UNSOL_RINGBACK_TONE: return "UNSOL_RINGBACK_TONG"; + case RIL_UNSOL_RESEND_INCALL_MUTE: return "UNSOL_RESEND_INCALL_MUTE"; default: return "<unknown reponse>"; } } diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java index c29adcf7e103..4d8c7ec86e87 100644 --- a/telephony/java/com/android/internal/telephony/RILConstants.java +++ b/telephony/java/com/android/internal/telephony/RILConstants.java @@ -259,4 +259,5 @@ cat include/telephony/ril.h | \ int RIL_UNSOL_CDMA_INFO_REC = 1027; int RIL_UNSOL_OEM_HOOK_RAW = 1028; int RIL_UNSOL_RINGBACK_TONE = 1029; + int RIL_UNSOL_RESEND_INCALL_MUTE = 1030; } |