diff options
author | Evan Charlton <evanc@google.com> | 2014-04-11 15:55:43 -0700 |
---|---|---|
committer | Evan Charlton <evanc@google.com> | 2014-04-11 16:02:15 -0700 |
commit | 3c7fbb2214368689e8868ca1f37c3490429c4b05 (patch) | |
tree | a633e4dbe6803639ff86e64ccc4788b0e1c1ec07 | |
parent | 792e41fe2a26cc7d41d192bd29b267550afbcdb5 (diff) | |
download | frameworks_base-3c7fbb2214368689e8868ca1f37c3490429c4b05.zip frameworks_base-3c7fbb2214368689e8868ca1f37c3490429c4b05.tar.gz frameworks_base-3c7fbb2214368689e8868ca1f37c3490429c4b05.tar.bz2 |
Expose a method to cancel an outgoing call
Expose a method which lets CallServiceSelectors abort an outgoing call.
Bug: 13980764
Change-Id: Id0c608729cb5de3e2a37b2538f1f61ed94bcb31b
4 files changed, 26 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt index 4763ca8..61c7227 100644 --- a/api/current.txt +++ b/api/current.txt @@ -25086,6 +25086,7 @@ package android.telecomm { public abstract class CallServiceSelector extends android.app.Service { ctor protected CallServiceSelector(); + method protected final void cancelOutgoingCall(android.telecomm.CallInfo); method protected final android.telecomm.CallServiceSelectorAdapter getAdapter(); method protected final java.util.Collection<android.telecomm.CallInfo> getCalls(); method protected void onAdapterAttached(android.telecomm.CallServiceSelectorAdapter); @@ -25094,6 +25095,7 @@ package android.telecomm { } public final class CallServiceSelectorAdapter { + method public void cancelOutgoingCall(java.lang.String); method public void setHandoffInfo(java.lang.String, android.net.Uri, android.os.Bundle); method public void setSelectedCallServices(java.lang.String, java.util.List<android.telecomm.CallServiceDescriptor>); } diff --git a/telecomm/java/android/telecomm/CallServiceSelector.java b/telecomm/java/android/telecomm/CallServiceSelector.java index 8c9495f..c9c6ff6 100644 --- a/telecomm/java/android/telecomm/CallServiceSelector.java +++ b/telecomm/java/android/telecomm/CallServiceSelector.java @@ -121,6 +121,16 @@ public abstract class CallServiceSelector extends Service { } /** + * Cancel the outgoing call. Any subsequent calls to {@link #select(CallInfo, List)} will be + * ignored. + * + * @param callInfo The call to canceled. + */ + protected final void cancelOutgoingCall(CallInfo callInfo) { + getAdapter().cancelOutgoingCall(callInfo.getId()); + } + + /** * Lifecycle callback which is called when this {@link CallServiceSelector} has been attached * to a {@link CallServiceSelectorAdapter}, indicating {@link #getAdapter()} is now safe to use. * diff --git a/telecomm/java/android/telecomm/CallServiceSelectorAdapter.java b/telecomm/java/android/telecomm/CallServiceSelectorAdapter.java index 8635f1a..4d2e8aa 100644 --- a/telecomm/java/android/telecomm/CallServiceSelectorAdapter.java +++ b/telecomm/java/android/telecomm/CallServiceSelectorAdapter.java @@ -56,6 +56,18 @@ public final class CallServiceSelectorAdapter { } /** + * Cancels the specified outgoing call. + * + * @param callId The ID of the call to cancel. + */ + public void cancelOutgoingCall(String callId) { + try { + mAdapter.cancelOutgoingCall(callId); + } catch (RemoteException e) { + } + } + + /** * Associates handoff information with an ongoing call. Calls can switch from one call service * to another. Setting handle to a non-null value marks the call as switchable. * diff --git a/telecomm/java/com/android/internal/telecomm/ICallServiceSelectorAdapter.aidl b/telecomm/java/com/android/internal/telecomm/ICallServiceSelectorAdapter.aidl index 1b281b9..ad71e3c 100644 --- a/telecomm/java/com/android/internal/telecomm/ICallServiceSelectorAdapter.aidl +++ b/telecomm/java/com/android/internal/telecomm/ICallServiceSelectorAdapter.aidl @@ -35,5 +35,7 @@ oneway interface ICallServiceSelectorAdapter { String callId, in List<CallServiceDescriptor> selectedCallServiceDescriptors); + void cancelOutgoingCall(String callId); + void setHandoffInfo(String callId, in Uri handle, in Bundle extras); } |