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 {
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 {
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";
}
}
import android.app.Service;
import android.content.Intent;
+import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
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);
}
@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
* 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
package android.telecomm;
+import android.os.Bundle;
import android.telecomm.CallInfo;
import android.telecomm.ICallServiceAdapter;
* 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
package android.telecomm;
+import android.os.Bundle;
+
/**
* Defines constants for use with the Telecomm system.
*/
*/
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";
}