diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 41157565bfddc..17bd08c183c5d 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -1804,6 +1804,13 @@ public abstract class Connection extends Conferenceable { */ public void onReject(String replyMessage) {} + /** + * Notifies the Connection of a request to silence the ringer. + * + * @hide + */ + public void onSilence() {} + /** * Notifies this Connection whether the user wishes to proceed with the post-dial DTMF codes. */ diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index 62234958517d9..b4a7ce0f56b13 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -102,6 +102,7 @@ public abstract class ConnectionService extends Service { private static final int MSG_MERGE_CONFERENCE = 18; private static final int MSG_SWAP_CONFERENCE = 19; private static final int MSG_REJECT_WITH_MESSAGE = 20; + private static final int MSG_SILENCE = 21; private static Connection sNullConnection; @@ -176,6 +177,11 @@ public abstract class ConnectionService extends Service { mHandler.obtainMessage(MSG_REJECT_WITH_MESSAGE, args).sendToTarget(); } + @Override + public void silence(String callId) { + mHandler.obtainMessage(MSG_SILENCE, callId).sendToTarget(); + } + @Override public void disconnect(String callId) { mHandler.obtainMessage(MSG_DISCONNECT, callId).sendToTarget(); @@ -319,6 +325,9 @@ public abstract class ConnectionService extends Service { case MSG_DISCONNECT: disconnect((String) msg.obj); break; + case MSG_SILENCE: + silence((String) msg.obj); + break; case MSG_HOLD: hold((String) msg.obj); break; @@ -708,6 +717,11 @@ public abstract class ConnectionService extends Service { findConnectionForAction(callId, "reject").onReject(rejectWithMessage); } + private void silence(String callId) { + Log.d(this, "silence %s", callId); + findConnectionForAction(callId, "silence").onSilence(); + } + private void disconnect(String callId) { Log.d(this, "disconnect %s", callId); if (mConnectionById.containsKey(callId)) { diff --git a/telecomm/java/com/android/internal/telecom/IConnectionService.aidl b/telecomm/java/com/android/internal/telecom/IConnectionService.aidl index dd253cfdfbe41..8a54addcf06e6 100644 --- a/telecomm/java/com/android/internal/telecom/IConnectionService.aidl +++ b/telecomm/java/com/android/internal/telecom/IConnectionService.aidl @@ -54,6 +54,8 @@ oneway interface IConnectionService { void disconnect(String callId); + void silence(String callId); + void hold(String callId); void unhold(String callId);