diff options
author | Tyler Gunn <tgunn@google.com> | 2016-02-16 14:36:20 -0800 |
---|---|---|
committer | Tyler Gunn <tgunn@google.com> | 2016-02-16 14:36:20 -0800 |
commit | bd1eb1f105e99d55fe87d758e8eafbe55a221a30 (patch) | |
tree | 7b3d184e5b2c12940ce34b57c90c09696d8f5e7c /telecomm/java/android/telecom/RemoteConnection.java | |
parent | d6b6e9c2efd3454b2ab047a506ce925e45ea75a0 (diff) |
Add new ConnectionEvent API (hide) to send a notification to Telecom
Connection event used to inform Telecom that it should play or stop
the on hold tone. This is used to play or stop a tone when the peer
puts the current call on hold.
BUG=25357778
Change-Id: I2669f8f5062449784a712b9dd28e576326fcc679
Diffstat (limited to 'telecomm/java/android/telecom/RemoteConnection.java')
-rw-r--r-- | telecomm/java/android/telecom/RemoteConnection.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/RemoteConnection.java b/telecomm/java/android/telecom/RemoteConnection.java index f9609590a697..01858080d7d7 100644 --- a/telecomm/java/android/telecom/RemoteConnection.java +++ b/telecomm/java/android/telecom/RemoteConnection.java @@ -209,6 +209,15 @@ public final class RemoteConnection { * @param extras The extras containing other information associated with the connection. */ public void onExtrasChanged(RemoteConnection connection, @Nullable Bundle extras) {} + + /** + * Handles a connection event propagated to this {@link RemoteConnection}. + * + * @param connection The {@code RemoteConnection} invoking this method. + * @param event The connection event. + * @hide + */ + public void onConnectionEvent(RemoteConnection connection, String event) {} } /** @@ -1291,6 +1300,20 @@ public final class RemoteConnection { } } + /** @hide */ + void onConnectionEvent(final String event) { + for (CallbackRecord record : mCallbackRecords) { + final RemoteConnection connection = this; + final Callback callback = record.getCallback(); + record.getHandler().post(new Runnable() { + @Override + public void run() { + callback.onConnectionEvent(connection, event); + } + }); + } + } + /** * Create a RemoteConnection represents a failure, and which will be in * {@link Connection#STATE_DISCONNECTED}. Attempting to use it for anything will almost |