summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryce Lee <brycelee@google.com>2015-11-17 15:13:29 -0800
committerBryce Lee <brycelee@google.com>2015-11-17 15:13:29 -0800
commitcac50775b2e13c293d224b8d09feb15f9ee40c3f (patch)
treecf33f354e6fdf4fe9f4d44ba3f8c1af565e322d2
parentcb8749c903d29fd04944550b5f34cc6120b69232 (diff)
downloadframeworks_base-cac50775b2e13c293d224b8d09feb15f9ee40c3f.zip
frameworks_base-cac50775b2e13c293d224b8d09feb15f9ee40c3f.tar.gz
frameworks_base-cac50775b2e13c293d224b8d09feb15f9ee40c3f.tar.bz2
Add callback for connections to be notified when the ringer is silenced.
Bug: 25644529 Change-Id: Ie7dc9028cf6243d98b2d87ca4c8b3ffcd31e3676
-rw-r--r--telecomm/java/android/telecom/Connection.java7
-rw-r--r--telecomm/java/android/telecom/ConnectionService.java14
-rw-r--r--telecomm/java/com/android/internal/telecom/IConnectionService.aidl2
3 files changed, 23 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index 430760a..520a1d7 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -1781,6 +1781,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.
*/
public void onPostDialContinue(boolean proceed) {}
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)) {
diff --git a/telecomm/java/com/android/internal/telecom/IConnectionService.aidl b/telecomm/java/com/android/internal/telecom/IConnectionService.aidl
index dd253cf..8a54add 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);