summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorBen Gilad <gilad@google.com>2014-02-18 19:48:48 -0800
committerEvan Charlton <evanc@google.com>2014-02-20 17:09:04 -0800
commit6adbaf70f31e29c52fd0bb8849774f58224df6f9 (patch)
tree10f42c6c0bfb038e4869be3246594259189529fc /telecomm
parent3342e77ec908ac55125b6dff6ae2545b862caece (diff)
downloadframeworks_base-6adbaf70f31e29c52fd0bb8849774f58224df6f9.zip
frameworks_base-6adbaf70f31e29c52fd0bb8849774f58224df6f9.tar.gz
frameworks_base-6adbaf70f31e29c52fd0bb8849774f58224df6f9.tar.bz2
Addressing the TODO to rename CallServiceInfo.
Also removing some unused imports etc. Change-Id: I48176d5394aee0110f3b7a081a1a616b72b574b9
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecomm/CallService.java11
-rw-r--r--telecomm/java/android/telecomm/CallServiceDescriptor.aidl (renamed from telecomm/java/android/telecomm/CallServiceInfo.aidl)2
-rw-r--r--telecomm/java/android/telecomm/CallServiceDescriptor.java (renamed from telecomm/java/android/telecomm/CallServiceInfo.java)37
-rw-r--r--telecomm/java/android/telecomm/CallServiceSelector.java15
-rw-r--r--telecomm/java/android/telecomm/ICallServiceLookupResponse.aidl14
-rw-r--r--telecomm/java/android/telecomm/ICallServiceSelectionResponse.aidl9
-rw-r--r--telecomm/java/android/telecomm/ICallServiceSelector.aidl8
7 files changed, 50 insertions, 46 deletions
diff --git a/telecomm/java/android/telecomm/CallService.java b/telecomm/java/android/telecomm/CallService.java
index a2fb7eb..7d1e32a 100644
--- a/telecomm/java/android/telecomm/CallService.java
+++ b/telecomm/java/android/telecomm/CallService.java
@@ -21,11 +21,8 @@ import android.content.Intent;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
-
import android.telecomm.ICallService;
import android.telecomm.ICallServiceAdapter;
-import android.util.Log;
-import android.util.Pair;
import com.android.internal.os.SomeArgs;
@@ -47,7 +44,6 @@ import com.android.internal.os.SomeArgs;
* TODO(santoscordon): Improve paragraph above once the final design is in place.
*/
public abstract class CallService extends Service {
- private static final String TAG = CallService.class.getSimpleName();
/**
* Default Handler used to consolidate binder method calls onto a single thread.
@@ -128,7 +124,7 @@ public abstract class CallService extends Service {
/**
* Message handler for consolidating binder callbacks onto a single thread.
- * See {@link #CallServiceMessageHandler}.
+ * See {@link CallServiceMessageHandler}.
*/
private final CallServiceMessageHandler mMessageHandler = new CallServiceMessageHandler();
@@ -138,6 +134,7 @@ public abstract class CallService extends Service {
private final CallServiceBinder mBinder = new CallServiceBinder();
/** {@inheritDoc} */
+ @Override
public IBinder onBind(Intent intent) {
return getBinder();
}
@@ -173,8 +170,8 @@ 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#newOutgoingCall} if it can successfully
- * make the call.
+ * call service respond via {@link ICallServiceAdapter#handleIncomingCall} if it can
+ * successfully make the call.
*
* @param callInfo The details of the relevant call.
*/
diff --git a/telecomm/java/android/telecomm/CallServiceInfo.aidl b/telecomm/java/android/telecomm/CallServiceDescriptor.aidl
index fa6dea0..f517c73 100644
--- a/telecomm/java/android/telecomm/CallServiceInfo.aidl
+++ b/telecomm/java/android/telecomm/CallServiceDescriptor.aidl
@@ -16,4 +16,4 @@
package android.telecomm;
-parcelable CallServiceInfo;
+parcelable CallServiceDescriptor;
diff --git a/telecomm/java/android/telecomm/CallServiceInfo.java b/telecomm/java/android/telecomm/CallServiceDescriptor.java
index f6d0827..256b558 100644
--- a/telecomm/java/android/telecomm/CallServiceInfo.java
+++ b/telecomm/java/android/telecomm/CallServiceDescriptor.java
@@ -28,8 +28,8 @@ import java.util.UUID;
* An immutable object containing information about a given {@link CallService}. Instances are
* created using the enclosed {@link Builder}.
*/
-public final class CallServiceInfo implements Parcelable {
- private static final String TAG = CallServiceInfo.class.getSimpleName();
+public final class CallServiceDescriptor implements Parcelable {
+ private static final String TAG = CallServiceDescriptor.class.getSimpleName();
/**
* A placeholder value indicating an invalid network type.
@@ -77,7 +77,11 @@ public final class CallServiceInfo implements Parcelable {
*/
private final int mNetworkType;
- private CallServiceInfo(String callServiceId, ComponentName componentName, int networkType) {
+ private CallServiceDescriptor(
+ String callServiceId,
+ ComponentName componentName,
+ int networkType) {
+
mCallServiceId = callServiceId;
mComponentName = componentName;
mNetworkType = networkType;
@@ -113,8 +117,8 @@ public final class CallServiceInfo implements Parcelable {
}
/**
- * Creates {@link CallServiceInfo} instances. Builders should be created with the
- * {@link CallServiceInfo#newBuilder(Context)} method.
+ * Creates {@link CallServiceDescriptor} instances. Builders should be created with the
+ * {@link CallServiceDescriptor#newBuilder(Context)} method.
*/
public static class Builder {
/** The {@link Context} to use to verify {@link ComponentName} ownership. */
@@ -131,7 +135,7 @@ public final class CallServiceInfo implements Parcelable {
}
/**
- * Set which {@link CallService} this {@link CallServiceInfo} is describing.
+ * Set which {@link CallService} this {@link CallServiceDescriptor} is describing.
*
* @param callServiceClass The {@link CallService} class
* @return This {@link Builder} for method chaining.
@@ -143,7 +147,7 @@ public final class CallServiceInfo implements Parcelable {
/**
* Which network type the backing {@link CallService} requires. This must be one of the
- * {@link CallServiceInfo}.TYPE_* fields.
+ * {@link CallServiceDescriptor}.TYPE_* fields.
*
* @param networkType Which network type the backing {@link CallService} requires.
* @return This {@link Builder} for method chaining.
@@ -154,9 +158,9 @@ public final class CallServiceInfo implements Parcelable {
}
/**
- * @return A constructed {@link CallServiceInfo} object.
+ * @return A constructed {@link CallServiceDescriptor} object.
*/
- public CallServiceInfo build() {
+ public CallServiceDescriptor build() {
// STOPSHIP: Verify validity of ComponentName (permissions, intents, etc)
// Make sure that they passed in a valid network flag combination
@@ -168,7 +172,8 @@ public final class CallServiceInfo implements Parcelable {
}
// TODO: Should we use a sha1 of the ComponentName? Would prevent duplicates.
- return new CallServiceInfo(UUID.randomUUID().toString(), mComponentName, mNetworkType);
+ return new CallServiceDescriptor(
+ UUID.randomUUID().toString(), mComponentName, mNetworkType);
}
}
@@ -184,20 +189,20 @@ public final class CallServiceInfo implements Parcelable {
dest.writeInt(mNetworkType);
}
- static final Creator<CallServiceInfo> CREATOR = new Creator<CallServiceInfo>() {
+ static final Creator<CallServiceDescriptor> CREATOR = new Creator<CallServiceDescriptor>() {
@Override
- public CallServiceInfo createFromParcel(Parcel source) {
+ public CallServiceDescriptor createFromParcel(Parcel source) {
String id = source.readString();
ComponentName componentName = source.readParcelable(
- CallServiceInfo.class.getClassLoader());
+ CallServiceDescriptor.class.getClassLoader());
int networkType = source.readInt();
- return new CallServiceInfo(id, componentName, networkType);
+ return new CallServiceDescriptor(id, componentName, networkType);
}
@Override
- public CallServiceInfo[] newArray(int size) {
- return new CallServiceInfo[size];
+ public CallServiceDescriptor[] newArray(int size) {
+ return new CallServiceDescriptor[size];
}
};
}
diff --git a/telecomm/java/android/telecomm/CallServiceSelector.java b/telecomm/java/android/telecomm/CallServiceSelector.java
index 74f05fe..cef9987 100644
--- a/telecomm/java/android/telecomm/CallServiceSelector.java
+++ b/telecomm/java/android/telecomm/CallServiceSelector.java
@@ -49,13 +49,14 @@ public abstract class CallServiceSelector extends Service {
}
@Override
- public void select(CallInfo callInfo, List<CallServiceInfo> callServiceInfos,
+ public void select(CallInfo callInfo, List<CallServiceDescriptor> descriptors,
ICallServiceSelectionResponse response) throws RemoteException {
+
// Ensure that we're running with the app's normal permission level
long ident = Binder.clearCallingIdentity();
try {
- response.setSelectedCallServiceInfos(
- CallServiceSelector.this.select(callInfo, callServiceInfos));
+ response.setSelectedCallServiceDescriptors(
+ CallServiceSelector.this.select(callInfo, descriptors));
} finally {
Binder.restoreCallingIdentity(ident);
}
@@ -91,10 +92,10 @@ public abstract class CallServiceSelector extends Service {
* This method is not called on the UI thread and is safe to block.
*
* @param callInfo The call being placed using the {@link CallService}s.
- * @param callServiceInfos The details of the available {@link CallService}s with which to place
+ * @param descriptors The descriptors of the available {@link CallService}s with which to place
* the call.
- * @return A list of prioritized {@link CallServiceInfo}s to use to complete the given call.
+ * @return A list of prioritized call-service descriptors to use to complete the given call.
*/
- protected abstract List<CallServiceInfo> select(
- CallInfo callInfo, List<CallServiceInfo> callServiceInfos);
+ protected abstract List<CallServiceDescriptor> select(
+ CallInfo callInfo, List<CallServiceDescriptor> descriptors);
}
diff --git a/telecomm/java/android/telecomm/ICallServiceLookupResponse.aidl b/telecomm/java/android/telecomm/ICallServiceLookupResponse.aidl
index 146d5f6..2f27257 100644
--- a/telecomm/java/android/telecomm/ICallServiceLookupResponse.aidl
+++ b/telecomm/java/android/telecomm/ICallServiceLookupResponse.aidl
@@ -17,19 +17,19 @@
package android.telecomm;
import android.os.IBinder;
-import android.telecomm.CallServiceInfo;
+import android.telecomm.CallServiceDescriptor;
import java.util.List;
/**
- * Used by {@link ICallServiceProvider} to return a list of {@link ICallService} implementations.
+ * Used by {@link ICallServiceProvider} to return a list of {@link CallServiceDescriptor}s.
*/
oneway interface ICallServiceLookupResponse {
/**
- * Forwards the list of {@link ICallService}s as a list of {@link CallServiceInfo}s to be
- * processed by Telecomm which will choose which call service, among potentially many, to
- * place a call.
+ * 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 callServices The set of call service descriptors from {@link ICallServiceProvider}.
+ * @param callServiceDescriptors The set of call-service descriptors from
+ * {@link ICallServiceProvider}.
*/
- void setCallServices(in List<CallServiceInfo> callServices);
+ void setCallServiceDescriptors(in List<CallServiceDescriptor> callServiceDescriptors);
}
diff --git a/telecomm/java/android/telecomm/ICallServiceSelectionResponse.aidl b/telecomm/java/android/telecomm/ICallServiceSelectionResponse.aidl
index 1376763..51efb8e 100644
--- a/telecomm/java/android/telecomm/ICallServiceSelectionResponse.aidl
+++ b/telecomm/java/android/telecomm/ICallServiceSelectionResponse.aidl
@@ -17,7 +17,7 @@
package android.telecomm;
import android.os.IBinder;
-import android.telecomm.CallServiceInfo;
+import android.telecomm.CallServiceDescriptor;
import java.util.List;
/**
@@ -29,8 +29,9 @@ oneway interface ICallServiceSelectionResponse {
* Records the sorted set of call services that are preferred by the corresponding
* call-service selector.
*
- * @param selectedCallServiceInfos The prioritized list of preferred CallServices to use for
- * completing the call.
+ * @param selectedCallServiceDescriptors The prioritized list of preferred call-service
+ * descriptors to use for completing the call.
*/
- void setSelectedCallServiceInfos(in List<CallServiceInfo> selectedCallServiceInfos);
+ void setSelectedCallServiceDescriptors(
+ in List<CallServiceDescriptor> selectedCallServiceDescriptors);
}
diff --git a/telecomm/java/android/telecomm/ICallServiceSelector.aidl b/telecomm/java/android/telecomm/ICallServiceSelector.aidl
index 9652dec..8ca4c0c 100644
--- a/telecomm/java/android/telecomm/ICallServiceSelector.aidl
+++ b/telecomm/java/android/telecomm/ICallServiceSelector.aidl
@@ -17,7 +17,7 @@
package android.telecomm;
import android.telecomm.CallInfo;
-import android.telecomm.CallServiceInfo;
+import android.telecomm.CallServiceDescriptor;
import android.telecomm.ICallService;
import android.telecomm.ICallServiceSelectionResponse;
import android.telecomm.ICallSwitchabilityResponse;
@@ -65,17 +65,17 @@ import java.util.List;
oneway interface ICallServiceSelector {
/**
- * Initiates the process to retrieve the sorted set of call service IDs that are preferred by
+ * Initiates the process to retrieve the sorted set of call services that are preferred by
* this call-service selector.
*
* @param callInfo The details of the relevant call.
- * @param callServiceIds The list of call-service IDs.
+ * @param callServiceDescriptors The list of call-service descriptors to select from.
* @param response The response object through which the selected service IDs are passed back
* to Telecomm.
*/
void select(
in CallInfo callInfo,
- in List<CallServiceInfo> callServiceInfos,
+ in List<CallServiceDescriptor> callServiceDescriptors,
in ICallServiceSelectionResponse response);
/**