From 8190168077aa3ef02a1f5a3a636130d83c4eec1d Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Fri, 28 Aug 2015 16:38:02 -0700 Subject: Add capability for a connection hand rejection text response. Change-Id: Id90417736bed7ab8750144ccaf3c7b449ec832b8 --- .../java/android/telecom/ConnectionService.java | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'telecomm/java/android/telecom/ConnectionService.java') diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index 383e45b..4e330bd 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -101,6 +101,7 @@ public abstract class ConnectionService extends Service { private static final int MSG_ANSWER_VIDEO = 17; 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 Connection sNullConnection; @@ -166,6 +167,14 @@ public abstract class ConnectionService extends Service { } @Override + public void rejectWithMessage(String callId, String message) { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = callId; + args.arg2 = message; + mHandler.obtainMessage(MSG_REJECT_WITH_MESSAGE, args).sendToTarget(); + } + + @Override public void disconnect(String callId) { mHandler.obtainMessage(MSG_DISCONNECT, callId).sendToTarget(); } @@ -296,6 +305,15 @@ public abstract class ConnectionService extends Service { case MSG_REJECT: reject((String) msg.obj); break; + case MSG_REJECT_WITH_MESSAGE: { + SomeArgs args = (SomeArgs) msg.obj; + try { + reject((String) args.arg1, (String) args.arg2); + } finally { + args.recycle(); + } + break; + } case MSG_DISCONNECT: disconnect((String) msg.obj); break; @@ -681,6 +699,11 @@ public abstract class ConnectionService extends Service { findConnectionForAction(callId, "reject").onReject(); } + private void reject(String callId, String rejectWithMessage) { + Log.d(this, "reject %s with message", callId); + findConnectionForAction(callId, "reject").onReject(rejectWithMessage); + } + private void disconnect(String callId) { Log.d(this, "disconnect %s", callId); if (mConnectionById.containsKey(callId)) { -- cgit v1.1 From cac50775b2e13c293d224b8d09feb15f9ee40c3f Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Tue, 17 Nov 2015 15:13:29 -0800 Subject: Add callback for connections to be notified when the ringer is silenced. Bug: 25644529 Change-Id: Ie7dc9028cf6243d98b2d87ca4c8b3ffcd31e3676 --- telecomm/java/android/telecom/ConnectionService.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'telecomm/java/android/telecom/ConnectionService.java') diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index 4e330bd..ceaa1bf 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; @@ -175,6 +176,11 @@ public abstract class ConnectionService extends Service { } @Override + public void silence(String callId) { + mHandler.obtainMessage(MSG_SILENCE, callId).sendToTarget(); + } + + @Override public void disconnect(String callId) { mHandler.obtainMessage(MSG_DISCONNECT, callId).sendToTarget(); } @@ -317,6 +323,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; @@ -704,6 +713,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)) { -- cgit v1.1