summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorBen Gilad <gilad@google.com>2014-03-04 16:40:58 -0800
committerBen Gilad <gilad@google.com>2014-03-05 17:23:41 -0800
commit3fadaa923272675d841eda3d46b3e1d9dc08c819 (patch)
tree1c073a8e557f9502914b153ef602c1a34849943d /telecomm
parent85c701ca0a35a9ca4ff2d74a18bd065368f64b8d (diff)
downloadframeworks_base-3fadaa923272675d841eda3d46b3e1d9dc08c819.zip
frameworks_base-3fadaa923272675d841eda3d46b3e1d9dc08c819.tar.gz
frameworks_base-3fadaa923272675d841eda3d46b3e1d9dc08c819.tar.bz2
Add the abort API to ICallService implementations.
Change-Id: Ie9b996b4d23184034811ef5667403ff4e47ae2d9
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecomm/CallService.java42
-rw-r--r--telecomm/java/android/telecomm/CallState.java1
-rw-r--r--telecomm/java/android/telecomm/ICallService.aidl21
3 files changed, 48 insertions, 16 deletions
diff --git a/telecomm/java/android/telecomm/CallService.java b/telecomm/java/android/telecomm/CallService.java
index 0eb96cc..f90ce97 100644
--- a/telecomm/java/android/telecomm/CallService.java
+++ b/telecomm/java/android/telecomm/CallService.java
@@ -59,8 +59,8 @@ public abstract class CallService extends Service {
case MSG_CALL:
call((CallInfo) msg.obj);
break;
- case MSG_DISCONNECT:
- disconnect((String) msg.obj);
+ case MSG_ABORT:
+ abort((String) msg.obj);
break;
case MSG_SET_INCOMING_CALL_ID:
setIncomingCallId((String) msg.obj);
@@ -71,6 +71,9 @@ public abstract class CallService extends Service {
case MSG_REJECT:
reject((String) msg.obj);
break;
+ case MSG_DISCONNECT:
+ disconnect((String) msg.obj);
+ break;
default:
break;
}
@@ -98,8 +101,8 @@ public abstract class CallService extends Service {
}
@Override
- public void disconnect(String callId) {
- mMessageHandler.obtainMessage(MSG_DISCONNECT, callId).sendToTarget();
+ public void abort(String callId) {
+ mMessageHandler.obtainMessage(MSG_ABORT, callId).sendToTarget();
}
@Override
@@ -116,6 +119,11 @@ public abstract class CallService extends Service {
public void reject(String callId) {
mMessageHandler.obtainMessage(MSG_REJECT, callId).sendToTarget();
}
+
+ @Override
+ public void disconnect(String callId) {
+ mMessageHandler.obtainMessage(MSG_DISCONNECT, callId).sendToTarget();
+ }
}
// Only used internally by this class.
@@ -127,10 +135,11 @@ public abstract class CallService extends Service {
MSG_SET_CALL_SERVICE_ADAPTER = 1,
MSG_IS_COMPATIBLE_WITH = 2,
MSG_CALL = 3,
- MSG_DISCONNECT = 4,
+ MSG_ABORT = 4,
MSG_SET_INCOMING_CALL_ID = 5,
MSG_ANSWER = 6,
- MSG_REJECT = 7;
+ MSG_REJECT = 7,
+ MSG_DISCONNECT = 8;
/**
* Message handler for consolidating binder callbacks onto a single thread.
@@ -169,7 +178,7 @@ public abstract class CallService extends Service {
/**
* Determines if the CallService can place the specified call. Response is sent via
* {@link ICallServiceAdapter#setCompatibleWith}. When responding, the correct call ID must be
- * specified.
+ * specified. Only used in the context of outgoing calls and call switching (handoff).
*
* @param callInfo The details of the relevant call.
*/
@@ -181,18 +190,22 @@ public abstract class CallService extends Service {
* dynamically extensible since call providers should be able to implement arbitrary
* handle-calling systems. See {@link #isCompatibleWith}. It is expected that the
* call service respond via {@link ICallServiceAdapter#handleSuccessfulOutgoingCall(String)}
- * if it can successfully make the call.
+ * if it can successfully make the call. Only used in the context of outgoing calls.
*
* @param callInfo The details of the relevant call.
*/
public abstract void call(CallInfo callInfo);
/**
- * Disconnects the specified call.
+ * Aborts the outgoing call attempt. Invoked in the unlikely event that Telecomm decides to
+ * abort an attempt to place a call. Only ever be invoked after {@link #call} invocations.
+ * After this is invoked, Telecomm does not expect any more updates about the call and will
+ * actively ignore any such update. This is different from {@link #disconnect} where Telecomm
+ * expects confirmation via {@link #markCallAsDisconnected}.
*
- * @param callId The ID of the call to disconnect.
+ * @param callId The identifier of the call to abort.
*/
- public abstract void disconnect(String callId);
+ public abstract void abort(String callId);
/**
* Receives a new call ID to use with an incoming call. Invoked by Telecomm after it is notified
@@ -220,4 +233,11 @@ public abstract class CallService extends Service {
* @param callId The ID of the call.
*/
public abstract void reject(String callId);
+
+ /**
+ * Disconnects the specified call.
+ *
+ * @param callId The ID of the call to disconnect.
+ */
+ public abstract void disconnect(String callId);
}
diff --git a/telecomm/java/android/telecomm/CallState.java b/telecomm/java/android/telecomm/CallState.java
index d4a45f9..d699fbd 100644
--- a/telecomm/java/android/telecomm/CallState.java
+++ b/telecomm/java/android/telecomm/CallState.java
@@ -67,6 +67,7 @@ public enum CallState {
/**
* Indicates that the call was attempted (mostly in the context of outgoing, at least at the
* time of writing) but cancelled before it was successfully connected.
+ * @hide
*/
ABORTED;
}
diff --git a/telecomm/java/android/telecomm/ICallService.aidl b/telecomm/java/android/telecomm/ICallService.aidl
index 6f3c4d46..a4c2599 100644
--- a/telecomm/java/android/telecomm/ICallService.aidl
+++ b/telecomm/java/android/telecomm/ICallService.aidl
@@ -48,7 +48,7 @@ oneway interface ICallService {
* specified. It is expected that the call service respond within 500 milliseconds. Any response
* that takes longer than 500 milliseconds will be treated as being incompatible.
* TODO(santoscordon): 500 ms was arbitrarily chosen and must be confirmed before this
- * API is made public.
+ * API is made public. Only used in the context of outgoing calls and call switching (handoff).
*
* @param callInfo The details of the relevant call.
*/
@@ -60,7 +60,7 @@ oneway interface ICallService {
* dynamically extensible since call providers should be able to implement arbitrary
* handle-calling systems. See {@link #isCompatibleWith}. It is expected that the
* call service respond via {@link ICallServiceAdapter#handleSuccessfulOutgoingCall} if it can
- * successfully make the call.
+ * successfully make the call. Only used in the context of outgoing calls.
* TODO(santoscordon): Figure out how a call service can short-circuit a failure to the adapter.
*
* @param callInfo The details of the relevant call.
@@ -68,11 +68,15 @@ oneway interface ICallService {
void call(in CallInfo callInfo);
/**
- * Disconnects the call identified by callId.
+ * Aborts the outgoing call attempt. Invoked in the unlikely event that Telecomm decides to
+ * abort an attempt to place a call. Only ever be invoked after {@link #call} invocations.
+ * After this is invoked, Telecomm does not expect any more updates about the call and will
+ * actively ignore any such update. This is different from {@link #disconnect} where Telecomm
+ * expects confirmation via {@link #markCallAsDisconnected}.
*
- * @param callId The identifier of the call to disconnect.
+ * @param callId The identifier of the call to abort.
*/
- void disconnect(String callId);
+ void abort(String callId);
/**
* Receives a new call ID to use with an incoming call. Invoked by Telecomm after it is notified
@@ -100,4 +104,11 @@ oneway interface ICallService {
* @param callId The ID of the call.
*/
void reject(String callId);
+
+ /**
+ * Disconnects the call identified by callId. Used for outgoing and incoming calls.
+ *
+ * @param callId The identifier of the call to disconnect.
+ */
+ void disconnect(String callId);
}