summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorSailesh Nepal <sail@google.com>2014-03-08 18:01:06 -0800
committerSailesh Nepal <sail@google.com>2014-03-11 16:38:50 -0700
commitab5d282dd6f487578ae86b2d53d0d8edc9b71747 (patch)
tree5bdb3946d832b66c6c9d65a41c983b5518d55341 /telecomm
parent4d0cf0c53a8b8e331ced0874d39d6ad4a6122ffc (diff)
downloadframeworks_base-ab5d282dd6f487578ae86b2d53d0d8edc9b71747.zip
frameworks_base-ab5d282dd6f487578ae86b2d53d0d8edc9b71747.tar.gz
frameworks_base-ab5d282dd6f487578ae86b2d53d0d8edc9b71747.tar.bz2
Add wrappers around telecomm interfaces
This CL adds wrappers for: CallServiceLookupResponse CallServiceAdapter IInCallAdapter IInCallService This CL also moves all the aidl files into com.android.internal.telecomm. Change-Id: I840f023bc545643e8bb719825e7bc78344ee46ee
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecomm/CallService.java22
-rw-r--r--telecomm/java/android/telecomm/CallServiceAdapter.java143
-rw-r--r--telecomm/java/android/telecomm/CallServiceLookupResponse.java51
-rw-r--r--telecomm/java/android/telecomm/CallServiceProvider.java14
-rw-r--r--telecomm/java/android/telecomm/CallServiceSelector.java5
-rw-r--r--telecomm/java/android/telecomm/InCallAdapter.java81
-rw-r--r--telecomm/java/android/telecomm/InCallService.java139
-rw-r--r--telecomm/java/android/telecomm/TelecommConstants.java15
-rw-r--r--telecomm/java/com/android/internal/telecomm/ICallService.aidl (renamed from telecomm/java/android/telecomm/ICallService.aidl)6
-rw-r--r--telecomm/java/com/android/internal/telecomm/ICallServiceAdapter.aidl (renamed from telecomm/java/android/telecomm/ICallServiceAdapter.aidl)9
-rw-r--r--telecomm/java/com/android/internal/telecomm/ICallServiceLookupResponse.aidl (renamed from telecomm/java/android/telecomm/ICallServiceLookupResponse.aidl)3
-rw-r--r--telecomm/java/com/android/internal/telecomm/ICallServiceProvider.aidl (renamed from telecomm/java/android/telecomm/ICallServiceProvider.aidl)9
-rw-r--r--telecomm/java/com/android/internal/telecomm/ICallServiceSelectionResponse.aidl (renamed from telecomm/java/android/telecomm/ICallServiceSelectionResponse.aidl)3
-rw-r--r--telecomm/java/com/android/internal/telecomm/ICallServiceSelector.aidl (renamed from telecomm/java/android/telecomm/ICallServiceSelector.aidl)10
-rw-r--r--telecomm/java/com/android/internal/telecomm/ICallSwitchabilityResponse.aidl (renamed from telecomm/java/android/telecomm/ICallSwitchabilityResponse.aidl)3
-rw-r--r--telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl (renamed from telecomm/java/android/telecomm/IInCallAdapter.aidl)3
-rw-r--r--telecomm/java/com/android/internal/telecomm/IInCallService.aidl (renamed from telecomm/java/android/telecomm/IInCallService.aidl)17
17 files changed, 489 insertions, 44 deletions
diff --git a/telecomm/java/android/telecomm/CallService.java b/telecomm/java/android/telecomm/CallService.java
index d1d0977..87a5372 100644
--- a/telecomm/java/android/telecomm/CallService.java
+++ b/telecomm/java/android/telecomm/CallService.java
@@ -24,13 +24,15 @@ import android.os.IBinder;
import android.os.Message;
import com.android.internal.os.SomeArgs;
+import com.android.internal.telecomm.ICallService;
+import com.android.internal.telecomm.ICallServiceAdapter;
/**
* Base implementation of CallService which can be used to provide calls for the system
* in-call UI. CallService is a one-way service from the framework's CallsManager to any app
* that would like to provide calls managed by the default system in-call user interface.
* When the service is bound by the framework, CallsManager will call setCallServiceAdapter
- * which will provide CallService with an instance of {@link ICallServiceAdapter} to be used
+ * which will provide CallService with an instance of {@link CallServiceAdapter} to be used
* for communicating back to CallsManager. Subsequently, more specific methods of the service
* will be called to perform various call actions including making an outgoing call and
* disconnected existing calls.
@@ -52,7 +54,9 @@ public abstract class CallService extends Service {
public void handleMessage(Message msg) {
switch (msg.what) {
case MSG_SET_CALL_SERVICE_ADAPTER:
- setCallServiceAdapter((ICallServiceAdapter) msg.obj);
+ CallServiceAdapter adapter =
+ new CallServiceAdapter((ICallServiceAdapter) msg.obj);
+ setCallServiceAdapter(adapter);
break;
case MSG_IS_COMPATIBLE_WITH:
isCompatibleWith((CallInfo) msg.obj);
@@ -177,18 +181,16 @@ public abstract class CallService extends Service {
}
/**
- * Sets an implementation of ICallServiceAdapter for adding new calls and communicating state
+ * Sets an implementation of CallServiceAdapter for adding new calls and communicating state
* changes of existing calls.
- * TODO(santoscordon): Should we not reference ICallServiceAdapter directly from here? Should we
- * wrap that in a wrapper like we do for CallService/ICallService?
*
* @param callServiceAdapter Adapter object for communicating call to CallsManager
*/
- public abstract void setCallServiceAdapter(ICallServiceAdapter callServiceAdapter);
+ public abstract void setCallServiceAdapter(CallServiceAdapter callServiceAdapter);
/**
* Determines if the CallService can place the specified call. Response is sent via
- * {@link ICallServiceAdapter#setCompatibleWith}. When responding, the correct call ID must be
+ * {@link CallServiceAdapter#setCompatibleWith}. When responding, the correct call ID must be
* specified. Only used in the context of outgoing calls and call switching (handoff).
*
* @param callInfo The details of the relevant call.
@@ -200,7 +202,7 @@ public abstract class CallService extends Service {
* SIP address, or some other kind of user ID. Note that the set of handle types is
* 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)}
+ * call service respond via {@link CallServiceAdapter#handleSuccessfulOutgoingCall(String)}
* if it can successfully make the call. Only used in the context of outgoing calls.
*
* @param callInfo The details of the relevant call.
@@ -212,7 +214,7 @@ public abstract class CallService extends Service {
* 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 ICallServiceAdapter.markCallAsDisconnected.
+ * expects confirmation via CallServiceAdapter.markCallAsDisconnected.
*
* @param callId The identifier of the call to abort.
*/
@@ -222,7 +224,7 @@ public abstract class CallService extends Service {
* Receives a new call ID to use with an incoming call. Invoked by Telecomm after it is notified
* that this call service has a pending incoming call, see
* {@link TelecommConstants#ACTION_INCOMING_CALL}. The call service must first give Telecomm
- * additional information about the call through {@link ICallServiceAdapter#handleIncomingCall}.
+ * additional information about the call through {@link CallServiceAdapter#handleIncomingCall}.
* Following that, the call service can update the call at will using the specified call ID.
*
* If a {@link Bundle} was passed (via {@link TelecommConstants#EXTRA_INCOMING_CALL_EXTRAS}) in
diff --git a/telecomm/java/android/telecomm/CallServiceAdapter.java b/telecomm/java/android/telecomm/CallServiceAdapter.java
new file mode 100644
index 0000000..a391f34
--- /dev/null
+++ b/telecomm/java/android/telecomm/CallServiceAdapter.java
@@ -0,0 +1,143 @@
+/*
+ * 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.os.RemoteException;
+
+import com.android.internal.telecomm.ICallServiceAdapter;
+
+/**
+ * Provides methods for ICallService implementations to interact with the system phone app.
+ * TODO(santoscordon): Need final public-facing comments in this file.
+ */
+public final class CallServiceAdapter {
+ private final ICallServiceAdapter mAdapter;
+
+ /**
+ * {@hide}
+ */
+ public CallServiceAdapter(ICallServiceAdapter adapter) {
+ mAdapter = adapter;
+ }
+
+ /**
+ * Receives confirmation of a call service's ability to place a call. This method is used in
+ * response to {@link CallService#isCompatibleWith}.
+ *
+ * @param callId The identifier of the call for which compatibility is being received. This ID
+ * should correspond to the ID given as part of the call information in
+ * {@link CallService#isCompatibleWith}.
+ * @param isCompatible True if the call service can place the call.
+ */
+ public void setIsCompatibleWith(String callId, boolean isCompatible) {
+ try {
+ mAdapter.setIsCompatibleWith(callId, isCompatible);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * Provides Telecomm with the details of an incoming call. An invocation of this method must
+ * follow {@link CallService#setIncomingCallId} and use the call ID specified therein. Upon
+ * the invocation of this method, Telecomm will bring up the incoming-call interface where the
+ * user can elect to answer or reject a call.
+ *
+ * @param callInfo The details of the relevant call.
+ */
+ public void notifyIncomingCall(CallInfo callInfo) {
+ try {
+ mAdapter.notifyIncomingCall(callInfo);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * Tells Telecomm that an attempt to place the specified outgoing call succeeded.
+ * TODO(santoscordon): Consider adding a CallState parameter in case this outgoing call is
+ * somehow no longer in the DIALING state.
+ *
+ * @param callId The ID of the outgoing call.
+ */
+ public void handleSuccessfulOutgoingCall(String callId) {
+ try {
+ mAdapter.handleSuccessfulOutgoingCall(callId);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * Tells Telecomm that an attempt to place the specified outgoing call failed.
+ *
+ * @param callId The ID of the outgoing call.
+ * @param errorMessage The error associated with the failed call attempt.
+ */
+ public void handleFailedOutgoingCall(String callId, String errorMessage) {
+ try {
+ mAdapter.handleFailedOutgoingCall(callId, errorMessage);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * Sets a call's state to active (e.g., an ongoing call where two parties can actively
+ * communicate).
+ *
+ * @param callId The unique ID of the call whose state is changing to active.
+ */
+ public void setActive(String callId) {
+ try {
+ mAdapter.setActive(callId);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * Sets a call's state to ringing (e.g., an inbound ringing call).
+ *
+ * @param callId The unique ID of the call whose state is changing to ringing.
+ */
+ public void setRinging(String callId) {
+ try {
+ mAdapter.setRinging(callId);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * Sets a call's state to dialing (e.g., dialing an outbound call).
+ *
+ * @param callId The unique ID of the call whose state is changing to dialing.
+ */
+ public void setDialing(String callId) {
+ try {
+ mAdapter.setDialing(callId);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * Sets a call's state to disconnected.
+ *
+ * @param callId The unique ID of the call whose state is changing to disconnected.
+ */
+ public void setDisconnected(String callId) {
+ try {
+ mAdapter.setDisconnected(callId);
+ } catch (RemoteException e) {
+ }
+ }
+}
diff --git a/telecomm/java/android/telecomm/CallServiceLookupResponse.java b/telecomm/java/android/telecomm/CallServiceLookupResponse.java
new file mode 100644
index 0000000..dd35a24
--- /dev/null
+++ b/telecomm/java/android/telecomm/CallServiceLookupResponse.java
@@ -0,0 +1,51 @@
+/*
+ * 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.os.RemoteException;
+
+import com.android.internal.telecomm.ICallServiceLookupResponse;
+
+import java.util.List;
+
+/**
+ * Used by {@link CallServiceProvider} to return a list of {@link CallServiceDescriptor}s.
+ */
+public final class CallServiceLookupResponse {
+ private final ICallServiceLookupResponse mResponse;
+
+ /**
+ * {@hide}
+ */
+ public CallServiceLookupResponse(ICallServiceLookupResponse response) {
+ mResponse = response;
+ }
+
+ /**
+ * Passes the sorted list of preferred {@link CallServiceDescriptor}s back to Telecomm. Used
+ * in the context of attempting to place a pending outgoing call.
+ *
+ * @param callServiceDescriptors The set of call-service descriptors from
+ * {@link CallServiceProvider}.
+ */
+ public void setCallServiceDescriptors(List<CallServiceDescriptor> callServiceDescriptors) {
+ try {
+ mResponse.setCallServiceDescriptors(callServiceDescriptors);
+ } catch (RemoteException e) {
+ }
+ }
+}
diff --git a/telecomm/java/android/telecomm/CallServiceProvider.java b/telecomm/java/android/telecomm/CallServiceProvider.java
index 64294d8..5db7e2e 100644
--- a/telecomm/java/android/telecomm/CallServiceProvider.java
+++ b/telecomm/java/android/telecomm/CallServiceProvider.java
@@ -22,8 +22,8 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
-import android.telecomm.ICallServiceProvider;
-import android.telecomm.ICallServiceLookupResponse;
+import com.android.internal.telecomm.ICallServiceLookupResponse;
+import com.android.internal.telecomm.ICallServiceProvider;
/**
* Base implementation of {@link ICallServiceProvider} which extends {@link Service}. This class
@@ -45,9 +45,9 @@ public abstract class CallServiceProvider extends Service {
public void handleMessage(Message msg) {
switch (msg.what) {
case MSG_LOOKUP_CALL_SERVICES:
- lookupCallServices((ICallServiceLookupResponse) msg.obj);
- break;
- default:
+ CallServiceLookupResponse response =
+ new CallServiceLookupResponse((ICallServiceLookupResponse) msg.obj);
+ lookupCallServices(response);
break;
}
}
@@ -100,10 +100,10 @@ public abstract class CallServiceProvider extends Service {
}
/**
- * Initiates the process to retrieve the list of {@link ICallService}s implemented by
+ * Initiates the process to retrieve the list of {@link CallServiceDescriptor}s implemented by
* this provider.
*
* @param response The response object through which the list of call services is sent.
*/
- public abstract void lookupCallServices(ICallServiceLookupResponse response);
+ public abstract void lookupCallServices(CallServiceLookupResponse response);
}
diff --git a/telecomm/java/android/telecomm/CallServiceSelector.java b/telecomm/java/android/telecomm/CallServiceSelector.java
index 6937bdf..44181d1 100644
--- a/telecomm/java/android/telecomm/CallServiceSelector.java
+++ b/telecomm/java/android/telecomm/CallServiceSelector.java
@@ -26,6 +26,9 @@ import android.os.RemoteException;
import android.util.Log;
import com.android.internal.os.SomeArgs;
+import com.android.internal.telecomm.ICallServiceSelector;
+import com.android.internal.telecomm.ICallServiceSelectionResponse;
+import com.android.internal.telecomm.ICallSwitchabilityResponse;
import java.util.List;
@@ -108,7 +111,7 @@ public abstract class CallServiceSelector extends Service {
}
};
- /** Manages the binder calls so that the implementor does not need to deal it. */
+ /** Manages the binder calls so that the implementor does not need to deal with it. */
private final class CallServiceSelectorBinder extends ICallServiceSelector.Stub
implements CallSwitchabilityResponse, CallServiceSelectionResponse {
private ICallSwitchabilityResponse mSwitchabilityResponse;
diff --git a/telecomm/java/android/telecomm/InCallAdapter.java b/telecomm/java/android/telecomm/InCallAdapter.java
new file mode 100644
index 0000000..c9bd8c2
--- /dev/null
+++ b/telecomm/java/android/telecomm/InCallAdapter.java
@@ -0,0 +1,81 @@
+/*
+ * 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.os.RemoteException;
+
+import com.android.internal.telecomm.IInCallAdapter;
+
+/**
+ * Receives commands from {@link InCallService} implementations which should be executed by
+ * Telecomm. When Telecomm binds to a {@link InCallService}, 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 InCallService#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.
+ */
+public final class InCallAdapter {
+ private final IInCallAdapter mAdapter;
+
+ /**
+ * {@hide}
+ */
+ public InCallAdapter(IInCallAdapter adapter) {
+ mAdapter = adapter;
+ }
+
+ /**
+ * Instructs Telecomm to answer the specified call.
+ *
+ * @param callId The identifier of the call to answer.
+ */
+ public void answerCall(String callId) {
+ try {
+ mAdapter.answerCall(callId);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * 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.
+ */
+ public void rejectCall(String callId) {
+ try {
+ mAdapter.rejectCall(callId);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
+ * Instructs Telecomm to disconnect the specified call.
+ *
+ * @param callId The identifier of the call to disconnect.
+ */
+ public void disconnectCall(String callId) {
+ try {
+ mAdapter.disconnectCall(callId);
+ } catch (RemoteException e) {
+ }
+ }
+}
diff --git a/telecomm/java/android/telecomm/InCallService.java b/telecomm/java/android/telecomm/InCallService.java
new file mode 100644
index 0000000..7819d44
--- /dev/null
+++ b/telecomm/java/android/telecomm/InCallService.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2013 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.app.Service;
+import android.content.Intent;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Looper;
+import android.os.Message;
+
+import com.android.internal.telecomm.IInCallAdapter;
+import com.android.internal.telecomm.IInCallService;
+
+/**
+ * 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 device implement this interface?
+ */
+public abstract class InCallService extends Service {
+ private static final int MSG_SET_IN_CALL_ADAPTER = 1;
+ private static final int MSG_ADD_CALL = 2;
+ private static final int MSG_SET_ACTIVE = 3;
+ private static final int MSG_SET_DISCONNECTED = 4;
+
+ /** Default Handler used to consolidate binder method calls onto a single thread. */
+ private final Handler mHandler = new Handler(Looper.getMainLooper()) {
+ @Override
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case MSG_SET_IN_CALL_ADAPTER:
+ InCallAdapter adapter = new InCallAdapter((IInCallAdapter) msg.obj);
+ setInCallAdapter(adapter);
+ break;
+ case MSG_ADD_CALL:
+ addCall((CallInfo) msg.obj);
+ break;
+ case MSG_SET_ACTIVE:
+ setActive((String) msg.obj);
+ break;
+ case MSG_SET_DISCONNECTED:
+ setDisconnected((String) msg.obj);
+ break;
+ default:
+ break;
+ }
+ }
+ };
+
+ /** Manages the binder calls so that the implementor does not need to deal with it. */
+ private final class InCallServiceBinder extends IInCallService.Stub {
+ /** {@inheritDoc} */
+ @Override
+ public void setInCallAdapter(IInCallAdapter inCallAdapter) {
+ mHandler.obtainMessage(MSG_SET_IN_CALL_ADAPTER, inCallAdapter).sendToTarget();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void addCall(CallInfo callInfo) {
+ mHandler.obtainMessage(MSG_ADD_CALL, callInfo).sendToTarget();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setActive(String callId) {
+ mHandler.obtainMessage(MSG_SET_ACTIVE, callId).sendToTarget();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setDisconnected(String callId) {
+ mHandler.obtainMessage(MSG_SET_DISCONNECTED, callId).sendToTarget();
+ }
+ }
+
+ private final InCallServiceBinder mBinder;
+
+ protected InCallService() {
+ mBinder = new InCallServiceBinder();
+ }
+
+ @Override
+ public final IBinder onBind(Intent intent) {
+ return mBinder;
+ }
+
+ /**
+ * 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.
+ */
+ protected abstract void setInCallAdapter(InCallAdapter 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.
+ */
+ protected abstract void addCall(CallInfo callInfo);
+
+ /**
+ * Indicates to the in-call app that a call has moved to the {@link CallState#ACTIVE} state.
+ *
+ * @param callId The identifier of the call that became active.
+ */
+ protected abstract void setActive(String callId);
+
+ /**
+ * Indicates to the in-call app that a call has been moved to the
+ * {@link CallState#DISCONNECTED} and the user should be notified.
+ * 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.
+ */
+ protected abstract void setDisconnected(String callId);
+}
diff --git a/telecomm/java/android/telecomm/TelecommConstants.java b/telecomm/java/android/telecomm/TelecommConstants.java
index 564f0cb..e6a086a 100644
--- a/telecomm/java/android/telecomm/TelecommConstants.java
+++ b/telecomm/java/android/telecomm/TelecommConstants.java
@@ -39,6 +39,21 @@ public final class TelecommConstants {
public static final String ACTION_INCOMING_CALL = "android.intent.action.INCOMING_CALL";
/**
+ * The service action used to bind to {@link CallServiceProvider} implementations.
+ */
+ public static final String ACTION_CALL_SERVICE_PROVIDER = CallServiceProvider.class.getName();
+
+ /**
+ * The service action used to bind to {@link CallService} implementations.
+ */
+ public static final String ACTION_CALL_SERVICE = CallService.class.getName();
+
+ /**
+ * The service action used to bind to {@link CallServiceSelector} implementations.
+ */
+ public static final String ACTION_CALL_SERVICE_SELECTOR = CallServiceSelector.class.getName();
+
+ /**
* Extra for {@link #ACTION_INCOMING_CALL} containing the {@link CallServiceDescriptor} that
* describes the call service to use for the incoming call.
*/
diff --git a/telecomm/java/android/telecomm/ICallService.aidl b/telecomm/java/com/android/internal/telecomm/ICallService.aidl
index 28f19ca..1df3f80 100644
--- a/telecomm/java/android/telecomm/ICallService.aidl
+++ b/telecomm/java/com/android/internal/telecomm/ICallService.aidl
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-package android.telecomm;
+package com.android.internal.telecomm;
import android.os.Bundle;
import android.telecomm.CallInfo;
-import android.telecomm.ICallServiceAdapter;
+
+import com.android.internal.telecomm.ICallServiceAdapter;
/**
* Service interface for services which would like to provide calls to be
@@ -31,6 +32,7 @@ import android.telecomm.ICallServiceAdapter;
* 2) Prior to an outbound call to test if this call service is compatible with the outgoing call.
*
* TODO(santoscordon): Need final public-facing comments in this file.
+ * {@hide}
*/
oneway interface ICallService {
diff --git a/telecomm/java/android/telecomm/ICallServiceAdapter.aidl b/telecomm/java/com/android/internal/telecomm/ICallServiceAdapter.aidl
index 2e03d39..7920b64 100644
--- a/telecomm/java/android/telecomm/ICallServiceAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecomm/ICallServiceAdapter.aidl
@@ -14,38 +14,37 @@
* limitations under the License.
*/
-package android.telecomm;
+package com.android.internal.telecomm;
import android.telecomm.CallInfo;
/**
* Provides methods for ICallService implementations to interact with the system phone app.
* TODO(santoscordon): Need final public-facing comments in this file.
+ * {@hide}
*/
oneway interface ICallServiceAdapter {
/**
* Receives confirmation of a call service's ability to place a call. This method is used in
* response to {@link ICallService#isCompatibleWith}.
- * TODO(santoscordon): rename to setIsCompatibleWith().
*
* @param callId The identifier of the call for which compatibility is being received. This ID
* should correspond to the ID given as part of the call information in
* {@link ICallService#isCompatibleWith}.
* @param isCompatible True if the call service can place the call.
*/
- void setCompatibleWith(String callId, boolean isCompatible);
+ void setIsCompatibleWith(String callId, boolean isCompatible);
/**
* Provides Telecomm with the details of an incoming call. An invocation of this method must
* follow {@link CallService#setIncomingCallId} and use the call ID specified therein. Upon
* the invocation of this method, Telecomm will bring up the incoming-call interface where the
* user can elect to answer or reject a call.
- * TODO(santoscordon): Consider renaming from handle* to notify*.
*
* @param callInfo The details of the relevant call.
*/
- void handleIncomingCall(in CallInfo callInfo);
+ void notifyIncomingCall(in CallInfo callInfo);
/**
* Tells Telecomm that an attempt to place the specified outgoing call succeeded.
diff --git a/telecomm/java/android/telecomm/ICallServiceLookupResponse.aidl b/telecomm/java/com/android/internal/telecomm/ICallServiceLookupResponse.aidl
index 2f27257..97fa834 100644
--- a/telecomm/java/android/telecomm/ICallServiceLookupResponse.aidl
+++ b/telecomm/java/com/android/internal/telecomm/ICallServiceLookupResponse.aidl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package android.telecomm;
+package com.android.internal.telecomm;
import android.os.IBinder;
import android.telecomm.CallServiceDescriptor;
@@ -22,6 +22,7 @@ import java.util.List;
/**
* Used by {@link ICallServiceProvider} to return a list of {@link CallServiceDescriptor}s.
+ * {@hide}
*/
oneway interface ICallServiceLookupResponse {
/**
diff --git a/telecomm/java/android/telecomm/ICallServiceProvider.aidl b/telecomm/java/com/android/internal/telecomm/ICallServiceProvider.aidl
index 8b0a736..39feddd 100644
--- a/telecomm/java/android/telecomm/ICallServiceProvider.aidl
+++ b/telecomm/java/com/android/internal/telecomm/ICallServiceProvider.aidl
@@ -14,9 +14,11 @@
* limitations under the License.
*/
-package android.telecomm;
+package com.android.internal.telecomm;
-import android.telecomm.ICallServiceLookupResponse;
+import android.telecomm.CallServiceDescriptor;
+
+import com.android.internal.telecomm.ICallServiceLookupResponse;
/**
* Interface for applications interested in providing call-service implementations. Only used in
@@ -30,11 +32,12 @@ import android.telecomm.ICallServiceLookupResponse;
* processed by the CallsManager and its helpers (potentially requesting input from the user) to
* identify the best CallService. The user should obviously be notified upon zero candidates as
* well as all (one or more) candidates failing to issue the call.
+ * {@hide}
*/
oneway interface ICallServiceProvider {
/**
- * Initiates the process to retrieve the list of {@link ICallService}s implemented by
+ * Initiates the process to retrieve the list of {@link CallServiceDescriptor}s implemented by
* this provider.
* TODO(santoscordon): Needs comments on how to populate the list within
* ICallServiceLookupResponse and how to handle error conditions.
diff --git a/telecomm/java/android/telecomm/ICallServiceSelectionResponse.aidl b/telecomm/java/com/android/internal/telecomm/ICallServiceSelectionResponse.aidl
index 51efb8e..8270aa5 100644
--- a/telecomm/java/android/telecomm/ICallServiceSelectionResponse.aidl
+++ b/telecomm/java/com/android/internal/telecomm/ICallServiceSelectionResponse.aidl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package android.telecomm;
+package com.android.internal.telecomm;
import android.os.IBinder;
import android.telecomm.CallServiceDescriptor;
@@ -23,6 +23,7 @@ import java.util.List;
/**
* Used by {@link ICallServiceSelector} to return the preferred list of {@link ICallService}
* implementations with which to connect the corresponding outgoing call.
+ * {@hide}
*/
oneway interface ICallServiceSelectionResponse {
/**
diff --git a/telecomm/java/android/telecomm/ICallServiceSelector.aidl b/telecomm/java/com/android/internal/telecomm/ICallServiceSelector.aidl
index 8ca4c0c..3b73d9b 100644
--- a/telecomm/java/android/telecomm/ICallServiceSelector.aidl
+++ b/telecomm/java/com/android/internal/telecomm/ICallServiceSelector.aidl
@@ -14,13 +14,14 @@
* limitations under the License.
*/
-package android.telecomm;
+package com.android.internal.telecomm;
import android.telecomm.CallInfo;
import android.telecomm.CallServiceDescriptor;
-import android.telecomm.ICallService;
-import android.telecomm.ICallServiceSelectionResponse;
-import android.telecomm.ICallSwitchabilityResponse;
+
+import com.android.internal.telecomm.ICallService;
+import com.android.internal.telecomm.ICallServiceSelectionResponse;
+import com.android.internal.telecomm.ICallSwitchabilityResponse;
import java.util.List;
@@ -61,6 +62,7 @@ import java.util.List;
* all supported (either for a given call or globally across a given selector) , isSwitchable
* below can return false blindly to suppress all "select" calls beyond the initial one (that
* is used to establish outgoing calls).
+ * {@hide}
*/
oneway interface ICallServiceSelector {
diff --git a/telecomm/java/android/telecomm/ICallSwitchabilityResponse.aidl b/telecomm/java/com/android/internal/telecomm/ICallSwitchabilityResponse.aidl
index afb4122..9a7e9e5 100644
--- a/telecomm/java/android/telecomm/ICallSwitchabilityResponse.aidl
+++ b/telecomm/java/com/android/internal/telecomm/ICallSwitchabilityResponse.aidl
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-package android.telecomm;
+package com.android.internal.telecomm;
/**
* Used by {@link ICallServiceSelector}s to return whether or not the relevant
* call is switchable.
+ * {@hide}
*/
oneway interface ICallSwitchabilityResponse {
/**
diff --git a/telecomm/java/android/telecomm/IInCallAdapter.aidl b/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl
index 9fb7d4d..d4e67fc 100644
--- a/telecomm/java/android/telecomm/IInCallAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package android.telecomm;
+package com.android.internal.telecomm;
/**
* Receives commands from {@link IInCallService} implementations which should be executed by
@@ -28,6 +28,7 @@ package android.telecomm;
* 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.
+ * {@hide}
*/
oneway interface IInCallAdapter {
/**
diff --git a/telecomm/java/android/telecomm/IInCallService.aidl b/telecomm/java/com/android/internal/telecomm/IInCallService.aidl
index bc3a6b6..05b0d20 100644
--- a/telecomm/java/android/telecomm/IInCallService.aidl
+++ b/telecomm/java/com/android/internal/telecomm/IInCallService.aidl
@@ -14,10 +14,11 @@
* limitations under the License.
*/
-package android.telecomm;
+package com.android.internal.telecomm;
import android.telecomm.CallInfo;
-import android.telecomm.IInCallAdapter;
+
+import com.android.internal.telecomm.IInCallAdapter;
/**
* This service is implemented by any app that wishes to provide the user-interface for managing
@@ -25,7 +26,8 @@ import android.telecomm.IInCallAdapter;
* 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?
+ * TODO(santoscordon): What happens if two or more apps on a given device implement this interface?
+ * {@hide}
*/
oneway interface IInCallService {
@@ -48,17 +50,16 @@ oneway interface IInCallService {
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.
+ * Indicates to the in-call app that a call has moved to the
+ * {@link android.telecomm.CallState#ACTIVE} state.
*
* @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.
+ * Indicates to the in-call app that a call has been moved to the
+ * {@link android.telecomm.CallState#DISCONNECTED} and the user should be notified.
* TODO(santoscordon): Needs disconnect-cause either as a numberical constant, string or both
* depending on what is ultimately needed to support all scenarios.
*