summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorSantos Cordon <santoscordon@google.com>2014-01-27 08:46:21 -0800
committerEvan Charlton <evanc@google.com>2014-02-20 15:12:53 -0800
commit8f3fd30a60d4a5b6e9c94d463681b0c0ac3f119e (patch)
tree9beaf85acf30ece14110e93573ea996d3a8f1211 /telecomm
parent658c0cf6c3140b5cafc4e8880e08a7dead39d24a (diff)
downloadframeworks_base-8f3fd30a60d4a5b6e9c94d463681b0c0ac3f119e.zip
frameworks_base-8f3fd30a60d4a5b6e9c94d463681b0c0ac3f119e.tar.gz
frameworks_base-8f3fd30a60d4a5b6e9c94d463681b0c0ac3f119e.tar.bz2
Add interfaces between Telecomm and InCall.
Change-Id: Ie0e8c5e6626e1db33eb1142b302bf415785cfe47
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecomm/IInCallAdapter.aidl55
-rw-r--r--telecomm/java/android/telecomm/IInCallService.aidl68
2 files changed, 123 insertions, 0 deletions
diff --git a/telecomm/java/android/telecomm/IInCallAdapter.aidl b/telecomm/java/android/telecomm/IInCallAdapter.aidl
new file mode 100644
index 0000000..9fb7d4d
--- /dev/null
+++ b/telecomm/java/android/telecomm/IInCallAdapter.aidl
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.telecomm;
+
+/**
+ * Receives commands from {@link IInCallService} implementations which should be executed by
+ * Telecomm. When Telecomm binds to a {@link IInCallService}, an instance of this class is given to
+ * the in-call service through which it can manipulate live (active, dialing, ringing) calls. When
+ * the in-call service is notified of new calls ({@link IInCallService#addCall}), it can use the
+ * given call IDs to execute commands such as {@link #answerCall} for incoming calls or
+ * {@link #disconnectCall} for active calls the user would like to end. Some commands are only
+ * appropriate for calls in certain states; please consult each method for such limitations.
+ * TODO(santoscordon): Needs more/better comments once the API is finalized.
+ * TODO(santoscordon): Specify the adapter will stop functioning when there are no more calls.
+ * TODO(santoscordon): Once we have proper "CallState" constant definitions, consider rewording
+ * the javadoc to reference those states precisely.
+ */
+oneway interface IInCallAdapter {
+ /**
+ * Instructs Telecomm to answer the specified call.
+ *
+ * @param callId The identifier of the call to answer.
+ */
+ void answerCall(String callId);
+
+ /**
+ * Instructs Telecomm to reject the specified call.
+ * TODO(santoscordon): Add reject-with-text-message parameter when that feature
+ * is ported over.
+ *
+ * @param callId The identifier of the call to reject.
+ */
+ void rejectCall(String callId);
+
+ /**
+ * Instructs Telecomm to disconnect the specified call.
+ *
+ * @param callId The identifier of the call to disconnect.
+ */
+ void disconnectCall(String callId);
+}
diff --git a/telecomm/java/android/telecomm/IInCallService.aidl b/telecomm/java/android/telecomm/IInCallService.aidl
new file mode 100644
index 0000000..bc3a6b6
--- /dev/null
+++ b/telecomm/java/android/telecomm/IInCallService.aidl
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.telecomm;
+
+import android.telecomm.CallInfo;
+import android.telecomm.IInCallAdapter;
+
+/**
+ * This service is implemented by any app that wishes to provide the user-interface for managing
+ * phone calls. Telecomm binds to this service while there exists a live (active or incoming)
+ * call, and uses it to notify the in-call app of any live and and recently disconnected calls.
+ * TODO(santoscordon): Needs more/better description of lifecycle once the interface is better
+ * defined.
+ * TODO(santoscordon): What happens if two or more apps on a given decide implement this interface?
+ */
+oneway interface IInCallService {
+
+ /**
+ * Provides the in-call app an adapter object through which to send call-commands such as
+ * answering and rejecting incoming calls, disconnecting active calls, and putting calls in
+ * special states (mute, hold, etc).
+ *
+ * @param inCallAdapter Adapter through which an in-call app can send call-commands to Telecomm.
+ */
+ void setInCallAdapter(in IInCallAdapter inCallAdapter);
+
+ /**
+ * Indicates to the in-call app that a new call has been created and an appropriate
+ * user-interface should be built and shown to notify the user. Information about the call
+ * including its current state is passed in through the callInfo object.
+ *
+ * @param callInfo Information about the new call.
+ */
+ void addCall(in CallInfo callInfo);
+
+ /**
+ * Indicates to the in-call app that a call has moved to the active state.
+ * TODO(santoscordon): link javadoc to "active" constant once CallState is defined.
+ *
+ * @param callId The identifier of the call that became active.
+ */
+ void setActive(String callId);
+
+ /**
+ * Indicates to the in-call app that a call has been disconnected and the user should be
+ * notified.
+ * TODO(santoscordon): link javadoc to "disconnected" constant once CallState is defined.
+ * TODO(santoscordon): Needs disconnect-cause either as a numberical constant, string or both
+ * depending on what is ultimately needed to support all scenarios.
+ *
+ * @param callId The identifier of the call that was disconnected.
+ */
+ void setDisconnected(String callId);
+}