summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorSantos Cordon <santoscordon@google.com>2014-01-08 13:52:54 -0800
committerEvan Charlton <evanc@google.com>2014-02-20 15:12:49 -0800
commit4939ccf7864b3b5664c6cdbe124e49e68030cfa9 (patch)
treec055d830daf360868765bc697d708b11d2c9587b /telecomm
parent6fee2ea8f887e32d4c4a8c35b0ff00ea7eeb2bb3 (diff)
downloadframeworks_base-4939ccf7864b3b5664c6cdbe124e49e68030cfa9.zip
frameworks_base-4939ccf7864b3b5664c6cdbe124e49e68030cfa9.tar.gz
frameworks_base-4939ccf7864b3b5664c6cdbe124e49e68030cfa9.tar.bz2
Remove CallServiceProviderAdapter and replace with CallServiceLookupResponse.
Change-Id: I55a574784162e3cc4a88b2889f1d14a07116f937
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecomm/CallServiceProvider.java43
-rw-r--r--telecomm/java/android/telecomm/ICallServiceLookupResponse.aidl (renamed from telecomm/java/android/telecomm/ICallServiceProviderAdapter.aidl)18
-rw-r--r--telecomm/java/android/telecomm/ICallServiceProvider.aidl24
3 files changed, 40 insertions, 45 deletions
diff --git a/telecomm/java/android/telecomm/CallServiceProvider.java b/telecomm/java/android/telecomm/CallServiceProvider.java
index 01e1271..998f001 100644
--- a/telecomm/java/android/telecomm/CallServiceProvider.java
+++ b/telecomm/java/android/telecomm/CallServiceProvider.java
@@ -21,19 +21,26 @@ import android.content.Intent;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
+import android.os.RemoteException;
import android.telecomm.ICallServiceProvider;
+import android.telecomm.ICallServiceLookupResponse;
+import android.util.Log;
/**
- * Base implementation of CallServiceProvider service which implements ICallServiceProvider.
- * Its primary function is to provide implementations of {@link ICallService} which itself
- * can be used to provide calls for the framework's telecomm component.
+ * Base implementation of {@link ICallServiceProvider} which extends {@link Service}. This class
+ * should be extended by an app that wants to supply phone calls to be handled and managed by
+ * the device's in-call interface. All method-calls from the framework to
+ * {@link ICallServiceProvider} are passed through to the main thread for before executing the
+ * overriden methods of CallServiceProvider.
*
* TODO(santoscordon): Improve paragraph above once the final design is in place. Needs more
* about how this can be used.
* @hide
*/
public abstract class CallServiceProvider extends Service {
+ /** Used to identify log entries by this class. */
+ private static final String TAG = CallServiceProvider.class.getSimpleName();
/**
* Default Handler used to consolidate binder method calls onto a single thread.
@@ -42,8 +49,8 @@ public abstract class CallServiceProvider extends Service {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
- case MSG_SET_CALL_SERVICE_PROVIDER_ADAPTER:
- setCallServiceProviderAdapter((ICallServiceProviderAdapter) msg.obj);
+ case MSG_LOOKUP_CALL_SERVICES:
+ lookupCallServices((ICallServiceLookupResponse) msg.obj);
break;
default:
break;
@@ -55,15 +62,13 @@ public abstract class CallServiceProvider extends Service {
* Default ICallServiceProvider implementation provided to CallsManager via {@link #onBind}.
*/
private final class CallServiceProviderWrapper extends ICallServiceProvider.Stub {
+ /** {@inheritDoc} */
@Override
- public void setCallServiceProviderAdapter(
- ICallServiceProviderAdapter CallServiceProviderAdapter) {
- mMessageHandler.obtainMessage(MSG_SET_CALL_SERVICE_PROVIDER_ADAPTER,
- CallServiceProviderAdapter).sendToTarget();
+ public void lookupCallServices(ICallServiceLookupResponse callServiceLookupResponse) {
+ Message message = mMessageHandler.obtainMessage(
+ MSG_LOOKUP_CALL_SERVICES, callServiceLookupResponse);
+ message.sendToTarget();
}
-
- @Override
- public void initiateDiscoveryProtocol() {}
}
// Only used internally by this class.
@@ -71,7 +76,7 @@ public abstract class CallServiceProvider extends Service {
// in conjunction with {@link #mMessageHandler} to ensure that all callbacks are handled on a
// single thread. Keeping it on a single thread allows CallService implementations to avoid
// needing multi-threaded code in their own callback routines.
- private static final int MSG_SET_CALL_SERVICE_PROVIDER_ADAPTER = 1;
+ private static final int MSG_LOOKUP_CALL_SERVICES = 1;
/**
* Message handler for consolidating binder callbacks onto a single thread.
@@ -99,12 +104,10 @@ public abstract class CallServiceProvider extends Service {
}
/**
- * Sets an implementation of ICallServiceProviderAdapter for adding providing instances of
- * ICallService.
- * TODO(santoscordon): Should we not reference ICallServiceProviderAdapter directly from here?
- * Should we wrap that in a wrapper like we do for CallServiceProvider/ICallServiceProvider?
- * @param callServiceAdapter Adapter object for communicating call to CallsManager
+ * Initiates the process to retrieve the list of {@link ICallService}s implemented by
+ * this provider.
+ *
+ * @param response The response object through which the list of call services is sent.
*/
- public abstract void setCallServiceProviderAdapter(
- ICallServiceProviderAdapter CallServiceProviderAdapter);
+ public abstract void lookupCallServices(ICallServiceLookupResponse response);
}
diff --git a/telecomm/java/android/telecomm/ICallServiceProviderAdapter.aidl b/telecomm/java/android/telecomm/ICallServiceLookupResponse.aidl
index ec88a06..4b59121 100644
--- a/telecomm/java/android/telecomm/ICallServiceProviderAdapter.aidl
+++ b/telecomm/java/android/telecomm/ICallServiceLookupResponse.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 The Android Open Source Project
+ * 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.
@@ -16,20 +16,18 @@
package android.telecomm;
-import android.telecomm.ICallService;
+import android.os.IBinder;
+import java.util.List;
/**
- * Provides ICallServiceProvider implementations with the relevant CallsManager APIs.
+ * Used by {@link ICallServiceProvider} to return a list of {@link ICallService} implementations.
* @hide
*/
-oneway interface ICallServiceProviderAdapter {
-
+oneway interface ICallServiceLookupResponse {
/**
- * Provides the CallsManager with the services made available by this application.
+ * Receives the list of {@link ICallService}s as a list of {@link IBinder}s.
*
- * @param callServices The relevant services to make the CallsManager aware of. Parameter is
- * a list of IBinder which can be cast to ICallService.
- * NOTE: IBinder is required by AIDL processor when passing a list of interfaces.
+ * @param bundle Container for the list of call services.
*/
- void registerCallServices(in List<IBinder> callServices);
+ void onResult(in List<IBinder> callServices);
}
diff --git a/telecomm/java/android/telecomm/ICallServiceProvider.aidl b/telecomm/java/android/telecomm/ICallServiceProvider.aidl
index 1bd8d1f..2e2610c 100644
--- a/telecomm/java/android/telecomm/ICallServiceProvider.aidl
+++ b/telecomm/java/android/telecomm/ICallServiceProvider.aidl
@@ -16,7 +16,7 @@
package android.telecomm;
-import android.telecomm.ICallServiceProviderAdapter;
+import android.telecomm.ICallServiceLookupResponse;
/**
* Interface for applications interested in providing call-service implementations. Only used in
@@ -24,9 +24,8 @@ import android.telecomm.ICallServiceProviderAdapter;
* decided dynamically (unlike incoming call scenario where the call-service is known).
*
* Intended usage at time of writing is: Call intent received by the CallsManager, which in turn
- * gathers and binds all ICallServiceProvider implementations (using the framework). The actual
- * bind is between each CallServiceProvider and the CallServiceProviderAdapter. Once bound, the
- * CallsManager invokes the initiateDiscoveryProtocol API of each bound provider and waits until
+ * gathers and binds all ICallServiceProvider implementations (using the framework). Once bound, the
+ * CallsManager invokes the lookupCallServices API of each bound provider and waits until
* either all providers reply (asynchronously) or some timeout is met. The resulted list is then
* 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
@@ -36,17 +35,12 @@ import android.telecomm.ICallServiceProviderAdapter;
oneway interface ICallServiceProvider {
/**
- * Sets an implementation of ICallServiceProviderAdapter to allow call-service providers to
- * communicate with the CallsManager.
+ * Initiates the process to retrieve the list of {@link ICallService}s implemented by
+ * this provider.
+ * TODO(santoscordon): Needs comments on how to populate the list within
+ * ICallServiceLookupResponse and how to handle error conditions.
*
- * @param callServiceProviderAdapter The interface through which {@link ICallService}
- * implementations are passed to CallsManager.
+ * @param response The response object through which the list of call services is sent.
*/
- void setCallServiceProviderAdapter(in ICallServiceProviderAdapter callServiceProviderAdapter);
-
- /**
- * Provides the application with the opportunity to "register" ICallServiceProvider
- * implementations with the CallsManager for the purpose of issuing outgoing calls.
- */
- void initiateDiscoveryProtocol();
+ void lookupCallServices(in ICallServiceLookupResponse response);
}