diff options
author | Sailesh Nepal <sail@google.com> | 2016-01-23 16:28:22 -0800 |
---|---|---|
committer | Sailesh Nepal <sail@google.com> | 2016-01-26 17:06:06 -0800 |
commit | 9c2618b17fe580d70994ba8f5d999f20804575f9 (patch) | |
tree | 6db0dab9c02ddf23ae059eee4786bfc1716a6a23 /telecomm/java/android/telecom/InCallService.java | |
parent | af8859fcaeac29e9cdb650523baa32fb8c02c8ff (diff) |
Expose a meta-data value to allow dialer ringing
This CL exposes a new meta-data, IN_CALL_SERVICE_RINGING. If this is set
to true then ringing is played by the dialer instead of Telecom.
This CL also adds a new silenceRinger() API to InCallService. This is
needed to implement ringer silence on volume key down.
BUG: 22857261
Change-Id: I498538282eddbb727104f5b879f25adbef4e6cf6
Diffstat (limited to 'telecomm/java/android/telecom/InCallService.java')
-rw-r--r-- | telecomm/java/android/telecom/InCallService.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/InCallService.java b/telecomm/java/android/telecom/InCallService.java index 426b240e9c78..671399b6f842 100644 --- a/telecomm/java/android/telecom/InCallService.java +++ b/telecomm/java/android/telecom/InCallService.java @@ -73,6 +73,7 @@ public abstract class InCallService extends Service { private static final int MSG_ON_CALL_AUDIO_STATE_CHANGED = 5; private static final int MSG_BRING_TO_FOREGROUND = 6; private static final int MSG_ON_CAN_ADD_CALL_CHANGED = 7; + private static final int MSG_SILENCE_RINGER = 8; /** Default Handler used to consolidate binder method calls onto a single thread. */ private final Handler mHandler = new Handler(Looper.getMainLooper()) { @@ -114,6 +115,9 @@ public abstract class InCallService extends Service { case MSG_ON_CAN_ADD_CALL_CHANGED: mPhone.internalSetCanAddCall(msg.arg1 == 1); break; + case MSG_SILENCE_RINGER: + mPhone.internalSilenceRinger(); + break; default: break; } @@ -165,6 +169,11 @@ public abstract class InCallService extends Service { mHandler.obtainMessage(MSG_ON_CAN_ADD_CALL_CHANGED, canAddCall ? 1 : 0, 0) .sendToTarget(); } + + @Override + public void silenceRinger() { + mHandler.obtainMessage(MSG_SILENCE_RINGER).sendToTarget(); + } } private Phone.Listener mPhoneListener = new Phone.Listener() { @@ -202,6 +211,12 @@ public abstract class InCallService extends Service { InCallService.this.onCanAddCallChanged(canAddCall); } + /** ${inheritDoc} */ + @Override + public void onSilenceRinger(Phone phone) { + InCallService.this.onSilenceRinger(); + } + }; private Phone mPhone; @@ -405,6 +420,12 @@ public abstract class InCallService extends Service { } /** + * Called to silence the ringer if a ringing call exists. + */ + public void onSilenceRinger() { + } + + /** * Used to issue commands to the {@link Connection.VideoProvider} associated with a * {@link Call}. */ |