summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.txt5
-rw-r--r--telecomm/java/android/telecomm/CallService.java24
-rw-r--r--telecomm/java/android/telecomm/ICallService.aidl9
-rw-r--r--telecomm/java/android/telecomm/TelecommConstants.java10
4 files changed, 41 insertions, 7 deletions
diff --git a/api/current.txt b/api/current.txt
index dff5171..b6905c0 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -24264,7 +24264,7 @@ package android.telecomm {
method public final android.os.IBinder onBind(android.content.Intent);
method public abstract void reject(java.lang.String);
method public abstract void setCallServiceAdapter(android.telecomm.ICallServiceAdapter);
- method public abstract void setIncomingCallId(java.lang.String);
+ method public abstract void setIncomingCallId(java.lang.String, android.os.Bundle);
}
public final class CallServiceDescriptor implements android.os.Parcelable {
@@ -24324,7 +24324,7 @@ package android.telecomm {
method public abstract void isCompatibleWith(android.telecomm.CallInfo) throws android.os.RemoteException;
method public abstract void reject(java.lang.String) throws android.os.RemoteException;
method public abstract void setCallServiceAdapter(android.telecomm.ICallServiceAdapter) throws android.os.RemoteException;
- method public abstract void setIncomingCallId(java.lang.String) throws android.os.RemoteException;
+ method public abstract void setIncomingCallId(java.lang.String, android.os.Bundle) throws android.os.RemoteException;
}
public static abstract class ICallService.Stub extends android.os.Binder implements android.telecomm.ICallService {
@@ -24439,6 +24439,7 @@ package android.telecomm {
ctor public TelecommConstants();
field public static final java.lang.String ACTION_INCOMING_CALL = "android.intent.action.INCOMING_CALL";
field public static final java.lang.String EXTRA_CALL_SERVICE_DESCRIPTOR = "android.intent.extra.CALL_SERVICE_DESCRIPTOR";
+ field public static final java.lang.String EXTRA_INCOMING_CALL_EXTRAS = "android.intent.extra.INCOMING_CALL_EXTRAS";
}
}
diff --git a/telecomm/java/android/telecomm/CallService.java b/telecomm/java/android/telecomm/CallService.java
index 0eb96cc..8767ffa 100644
--- a/telecomm/java/android/telecomm/CallService.java
+++ b/telecomm/java/android/telecomm/CallService.java
@@ -18,6 +18,7 @@ package android.telecomm;
import android.app.Service;
import android.content.Intent;
+import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
@@ -63,7 +64,14 @@ public abstract class CallService extends Service {
disconnect((String) msg.obj);
break;
case MSG_SET_INCOMING_CALL_ID:
- setIncomingCallId((String) msg.obj);
+ SomeArgs args = (SomeArgs) msg.obj;
+ try {
+ String callId = (String) args.arg1;
+ Bundle extras = (Bundle) args.arg2;
+ setIncomingCallId(callId, extras);
+ } finally {
+ args.recycle();
+ }
break;
case MSG_ANSWER:
answer((String) msg.obj);
@@ -103,8 +111,11 @@ public abstract class CallService extends Service {
}
@Override
- public void setIncomingCallId(String callId) {
- mMessageHandler.obtainMessage(MSG_SET_INCOMING_CALL_ID, callId).sendToTarget();
+ public void setIncomingCallId(String callId, Bundle extras) {
+ SomeArgs args = SomeArgs.obtain();
+ args.arg1 = callId;
+ args.arg2 = extras;
+ mMessageHandler.obtainMessage(MSG_SET_INCOMING_CALL_ID, args).sendToTarget();
}
@Override
@@ -201,9 +212,14 @@ public abstract class CallService extends Service {
* additional information about the call through {@link ICallServiceAdapter#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
+ * with the {@link TelecommConstants#ACTION_INCOMING_CALL} intent, <code>extras</code> will be
+ * populated with this {@link Bundle}. Otherwise, an empty Bundle will be returned.
+ *
* @param callId The ID of the call.
+ * @param extras The optional extras which were passed in with the intent, or an empty Bundle.
*/
- public abstract void setIncomingCallId(String callId);
+ public abstract void setIncomingCallId(String callId, Bundle extras);
/**
* Answers a ringing call identified by callId. Telecomm invokes this method as a result of the
diff --git a/telecomm/java/android/telecomm/ICallService.aidl b/telecomm/java/android/telecomm/ICallService.aidl
index 6f3c4d46..382bdd5 100644
--- a/telecomm/java/android/telecomm/ICallService.aidl
+++ b/telecomm/java/android/telecomm/ICallService.aidl
@@ -16,6 +16,7 @@
package android.telecomm;
+import android.os.Bundle;
import android.telecomm.CallInfo;
import android.telecomm.ICallServiceAdapter;
@@ -81,9 +82,15 @@ oneway interface ICallService {
* additional information of the call through {@link ICallServiceAdapter#handleIncomingCall}.
* Following that, the call service can update the call at will using the specified call ID.
*
+ * As part of the {@link TelecommConstants#ACTION_INCOMING_CALL} Intent, a Bundle of extra
+ * data could be sent via {@link TelecommConstants#EXTRA_INCOMING_CALL_EXTRAS}, which is
+ * returned through this method. If no data was given, an empty Bundle will be returned.
+ *
* @param callId The ID of the call.
+ * @param extras The Bundle of extra information passed via
+ * {@link TelecommConstants#EXTRA_INCOMING_CALL_EXTRAS}.
*/
- void setIncomingCallId(String callId);
+ void setIncomingCallId(String callId, in Bundle extras);
/**
* Answers a ringing call identified by callId. Telecomm invokes this method as a result of the
diff --git a/telecomm/java/android/telecomm/TelecommConstants.java b/telecomm/java/android/telecomm/TelecommConstants.java
index b0651c8..564f0cb 100644
--- a/telecomm/java/android/telecomm/TelecommConstants.java
+++ b/telecomm/java/android/telecomm/TelecommConstants.java
@@ -16,6 +16,8 @@
package android.telecomm;
+import android.os.Bundle;
+
/**
* Defines constants for use with the Telecomm system.
*/
@@ -42,4 +44,12 @@ public final class TelecommConstants {
*/
public static final String EXTRA_CALL_SERVICE_DESCRIPTOR =
"android.intent.extra.CALL_SERVICE_DESCRIPTOR";
+
+ /**
+ * Optional extra for {@link #ACTION_INCOMING_CALL} containing a {@link Bundle} which contains
+ * metadata about the call. This {@link Bundle} will be returned to the {@link CallService} as
+ * part of {@link CallService#setIncomingCallId(String,Bundle)}.
+ */
+ public static final String EXTRA_INCOMING_CALL_EXTRAS =
+ "android.intent.extra.INCOMING_CALL_EXTRAS";
}