Remove handoff APIs
This CL removes the old handoff APIs and renames handoffCall() to phoneAccountClicked(). Change-Id: Iab1595faaadcdfe428d97891d314babea21e9633
This commit is contained in:
@@ -27472,8 +27472,7 @@ package android.telecomm {
|
||||
public final class CallCapabilities {
|
||||
method public static java.lang.String toString(int);
|
||||
field public static final int ADD_CALL = 16; // 0x10
|
||||
field public static final int ALL = 511; // 0x1ff
|
||||
field public static final int CONNECTION_HANDOFF = 256; // 0x100
|
||||
field public static final int ALL = 255; // 0xff
|
||||
field public static final int GENERIC_CONFERENCE = 128; // 0x80
|
||||
field public static final int HOLD = 1; // 0x1
|
||||
field public static final int MERGE_CALLS = 4; // 0x4
|
||||
@@ -27515,43 +27514,8 @@ package android.telecomm {
|
||||
|
||||
public abstract class CallService extends android.app.Service {
|
||||
ctor public CallService();
|
||||
method public abstract void abort(java.lang.String);
|
||||
method public abstract void answer(java.lang.String);
|
||||
method public abstract void call(android.telecomm.CallInfo);
|
||||
method public abstract void disconnect(java.lang.String);
|
||||
method protected final android.telecomm.CallServiceAdapter getAdapter();
|
||||
method public final android.os.IBinder getBinder();
|
||||
method public abstract void hold(java.lang.String);
|
||||
method protected void onAdapterAttached(android.telecomm.CallServiceAdapter);
|
||||
method public abstract void onAudioStateChanged(java.lang.String, android.telecomm.CallAudioState);
|
||||
method public final android.os.IBinder onBind(android.content.Intent);
|
||||
method public abstract void onFeaturesChanged(java.lang.String, int);
|
||||
method public void onPostDialContinue(java.lang.String, boolean);
|
||||
method public void onPostDialWait(android.telecomm.Connection, java.lang.String);
|
||||
method public abstract void playDtmfTone(java.lang.String, char);
|
||||
method public abstract void reject(java.lang.String);
|
||||
method public abstract void setIncomingCallId(java.lang.String, android.os.Bundle);
|
||||
method public abstract void stopDtmfTone(java.lang.String);
|
||||
method public abstract void unhold(java.lang.String);
|
||||
}
|
||||
|
||||
public final class CallServiceAdapter implements android.os.IBinder.DeathRecipient {
|
||||
method public void addConferenceCall(java.lang.String);
|
||||
method public void binderDied();
|
||||
method public void cancelOutgoingCall(java.lang.String);
|
||||
method public void handleFailedOutgoingCall(android.telecomm.ConnectionRequest, int, java.lang.String);
|
||||
method public void handleSuccessfulOutgoingCall(java.lang.String);
|
||||
method public void handoffCall(java.lang.String);
|
||||
method public void notifyIncomingCall(android.telecomm.CallInfo);
|
||||
method public void onPostDialWait(java.lang.String, java.lang.String);
|
||||
method public void setActive(java.lang.String);
|
||||
method public void setCallVideoProvider(java.lang.String, android.telecomm.CallVideoProvider);
|
||||
method public void setDialing(java.lang.String);
|
||||
method public void setDisconnected(java.lang.String, int, java.lang.String);
|
||||
method public void setFeatures(java.lang.String, int);
|
||||
method public void setOnHold(java.lang.String);
|
||||
method public void setRequestingRingback(java.lang.String, boolean);
|
||||
method public void setRinging(java.lang.String);
|
||||
}
|
||||
|
||||
public final class CallServiceDescriptor implements android.os.Parcelable {
|
||||
@@ -27645,6 +27609,7 @@ package android.telecomm {
|
||||
method protected void onConference();
|
||||
method protected void onDisconnect();
|
||||
method protected void onHold();
|
||||
method protected void onPhoneAccountClicked();
|
||||
method protected void onPlayDtmfTone(char);
|
||||
method protected void onPostDialContinue(boolean);
|
||||
method protected void onReject();
|
||||
@@ -27694,27 +27659,15 @@ package android.telecomm {
|
||||
|
||||
public abstract class ConnectionService extends android.telecomm.CallService {
|
||||
ctor public ConnectionService();
|
||||
method public final void abort(java.lang.String);
|
||||
method public final void answer(java.lang.String);
|
||||
method public final void call(android.telecomm.CallInfo);
|
||||
method public final void createRemoteOutgoingConnection(android.telecomm.ConnectionRequest, android.telecomm.ConnectionService.OutgoingCallResponse<android.telecomm.RemoteConnection>);
|
||||
method public final void disconnect(java.lang.String);
|
||||
method public final java.util.Collection<android.telecomm.Connection> getAllConnections();
|
||||
method public final void hold(java.lang.String);
|
||||
method public final void lookupRemoteAccounts(android.net.Uri, android.telecomm.SimpleResponse<android.net.Uri, java.util.List<android.telecomm.PhoneAccount>>);
|
||||
method public final void maybeRespondToAccountLookup();
|
||||
method public final void onAudioStateChanged(java.lang.String, android.telecomm.CallAudioState);
|
||||
method protected void onConnectionAdded(android.telecomm.Connection);
|
||||
method protected void onConnectionRemoved(android.telecomm.Connection);
|
||||
method protected void onCreateConferenceConnection(java.lang.String, android.telecomm.Connection, android.telecomm.Response<java.lang.String, android.telecomm.Connection>);
|
||||
method protected void onCreateConnections(android.telecomm.ConnectionRequest, android.telecomm.ConnectionService.OutgoingCallResponse<android.telecomm.Connection>);
|
||||
method protected void onCreateIncomingConnection(android.telecomm.ConnectionRequest, android.telecomm.Response<android.telecomm.ConnectionRequest, android.telecomm.Connection>);
|
||||
method public final void onFeaturesChanged(java.lang.String, int);
|
||||
method public final void playDtmfTone(java.lang.String, char);
|
||||
method public final void reject(java.lang.String);
|
||||
method public final void setIncomingCallId(java.lang.String, android.os.Bundle);
|
||||
method public final void stopDtmfTone(java.lang.String);
|
||||
method public final void unhold(java.lang.String);
|
||||
}
|
||||
|
||||
public static abstract interface ConnectionService.OutgoingCallResponse {
|
||||
@@ -27736,9 +27689,9 @@ package android.telecomm {
|
||||
public final class InCallAdapter {
|
||||
method public void answerCall(java.lang.String);
|
||||
method public void disconnectCall(java.lang.String);
|
||||
method public void handoffCall(java.lang.String);
|
||||
method public void holdCall(java.lang.String);
|
||||
method public void mute(boolean);
|
||||
method public void phoneAccountClicked(java.lang.String);
|
||||
method public void playDtmfTone(java.lang.String, char);
|
||||
method public void postDialContinue(java.lang.String, boolean);
|
||||
method public void rejectCall(java.lang.String, boolean, java.lang.String);
|
||||
@@ -27760,7 +27713,6 @@ package android.telecomm {
|
||||
method public int getFeatures();
|
||||
method public android.telecomm.GatewayInfo getGatewayInfo();
|
||||
method public android.net.Uri getHandle();
|
||||
method public android.telecomm.CallServiceDescriptor getHandoffCallServiceDescriptor();
|
||||
method public java.lang.String getId();
|
||||
method public android.telecomm.CallState getState();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
|
||||
@@ -42,11 +42,8 @@ public final class CallCapabilities {
|
||||
/** Call supports generic conference mode. */
|
||||
public static final int GENERIC_CONFERENCE = 0x00000080;
|
||||
|
||||
/** Call currently supports switch between connections. */
|
||||
public static final int CONNECTION_HANDOFF = 0x00000100;
|
||||
|
||||
public static final int ALL = HOLD | SUPPORT_HOLD | MERGE_CALLS | SWAP_CALLS | ADD_CALL
|
||||
| RESPOND_VIA_TEXT | MUTE | GENERIC_CONFERENCE | CONNECTION_HANDOFF;
|
||||
| RESPOND_VIA_TEXT | MUTE | GENERIC_CONFERENCE;
|
||||
|
||||
public static String toString(int capabilities) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
@@ -75,9 +72,6 @@ public final class CallCapabilities {
|
||||
if ((capabilities & GENERIC_CONFERENCE) != 0) {
|
||||
builder.append(" GENERIC_CONFERENCE");
|
||||
}
|
||||
if ((capabilities & CONNECTION_HANDOFF) != 0) {
|
||||
builder.append(" HANDOFF");
|
||||
}
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
@@ -31,11 +31,6 @@ 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 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.
|
||||
* TODO(santoscordon): Needs more about AndroidManifest.xml service registrations before
|
||||
* we can unhide this API.
|
||||
*
|
||||
@@ -61,6 +56,7 @@ public abstract class CallService extends Service {
|
||||
private static final int MSG_CONFERENCE = 13;
|
||||
private static final int MSG_SPLIT_FROM_CONFERENCE = 14;
|
||||
private static final int MSG_ON_POST_DIAL_CONTINUE = 15;
|
||||
private static final int MSG_ON_PHONE_ACCOUNT_CLICKED = 16;
|
||||
|
||||
/**
|
||||
* Default Handler used to consolidate binder method calls onto a single thread.
|
||||
@@ -147,6 +143,9 @@ public abstract class CallService extends Service {
|
||||
case MSG_SPLIT_FROM_CONFERENCE:
|
||||
splitFromConference((String) msg.obj);
|
||||
break;
|
||||
case MSG_ON_PHONE_ACCOUNT_CLICKED:
|
||||
onPhoneAccountClicked((String) msg.obj);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -244,6 +243,12 @@ public abstract class CallService extends Service {
|
||||
args.argi1 = proceed ? 1 : 0;
|
||||
mMessageHandler.obtainMessage(MSG_ON_POST_DIAL_CONTINUE, args).sendToTarget();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPhoneAccountClicked(String callId) {
|
||||
mMessageHandler.obtainMessage(MSG_ON_PHONE_ACCOUNT_CLICKED, callId).sendToTarget();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -272,152 +277,59 @@ public abstract class CallService extends Service {
|
||||
return mBinder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The attached {@link CallServiceAdapter} if the service is bound, null otherwise.
|
||||
*/
|
||||
/** @hide */
|
||||
protected final CallServiceAdapter getAdapter() {
|
||||
return mAdapter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lifecycle callback which is called when this {@link CallService} has been attached to a
|
||||
* {@link CallServiceAdapter}, indicating {@link #getAdapter()} is now safe to use.
|
||||
*
|
||||
* @param adapter The adapter now attached to this call service.
|
||||
*/
|
||||
protected void onAdapterAttached(CallServiceAdapter adapter) {
|
||||
}
|
||||
/** @hide */
|
||||
protected abstract void onAdapterAttached(CallServiceAdapter adapter);
|
||||
|
||||
/**
|
||||
* Attempts to call the relevant party using the specified call's handle, be it a phone number,
|
||||
* 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.
|
||||
*
|
||||
* @param callInfo The details of the relevant call.
|
||||
*/
|
||||
public abstract void call(CallInfo callInfo);
|
||||
/** @hide */
|
||||
protected abstract void call(CallInfo callInfo);
|
||||
|
||||
/**
|
||||
* Aborts the outgoing call attempt. Invoked in the unlikely event that Telecomm decides to
|
||||
* 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 CallServiceAdapter.markCallAsDisconnected.
|
||||
*
|
||||
* @param callId The identifier of the call to abort.
|
||||
*/
|
||||
public abstract void abort(String callId);
|
||||
/** @hide */
|
||||
protected abstract void abort(String callId);
|
||||
|
||||
/**
|
||||
* 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 CallServiceAdapter#notifyIncomingCall}.
|
||||
* 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, Bundle extras);
|
||||
/** @hide */
|
||||
protected abstract void setIncomingCallId(String callId, Bundle extras);
|
||||
|
||||
/**
|
||||
* Answers a ringing call identified by callId. Telecomm invokes this method as a result of the
|
||||
* user hitting the "answer" button in the incoming call screen.
|
||||
*
|
||||
* @param callId The ID of the call.
|
||||
*/
|
||||
public abstract void answer(String callId);
|
||||
/** @hide */
|
||||
protected abstract void answer(String callId);
|
||||
|
||||
/**
|
||||
* Rejects a ringing call identified by callId. Telecomm invokes this method as a result of the
|
||||
* user hitting the "reject" button in the incoming call screen.
|
||||
*
|
||||
* @param callId The ID of the call.
|
||||
*/
|
||||
public abstract void reject(String callId);
|
||||
/** @hide */
|
||||
protected abstract void reject(String callId);
|
||||
|
||||
/**
|
||||
* Disconnects the specified call.
|
||||
*
|
||||
* @param callId The ID of the call to disconnect.
|
||||
*/
|
||||
public abstract void disconnect(String callId);
|
||||
/** @hide */
|
||||
protected abstract void disconnect(String callId);
|
||||
|
||||
/**
|
||||
* Puts the specified call on hold.
|
||||
*
|
||||
* @param callId The ID of the call to put on hold.
|
||||
*/
|
||||
public abstract void hold(String callId);
|
||||
/** @hide */
|
||||
protected abstract void hold(String callId);
|
||||
|
||||
/**
|
||||
* Removes the specified call from hold.
|
||||
*
|
||||
* @param callId The ID of the call to unhold.
|
||||
*/
|
||||
public abstract void unhold(String callId);
|
||||
/** @hide */
|
||||
protected abstract void unhold(String callId);
|
||||
|
||||
/**
|
||||
* Plays a dual-tone multi-frequency signaling (DTMF) tone in a call.
|
||||
*
|
||||
* @param callId The unique ID of the call in which the tone will be played.
|
||||
* @param digit A character representing the DTMF digit for which to play the tone. This
|
||||
* value must be one of {@code '0'} through {@code '9'}, {@code '*'} or {@code '#'}.
|
||||
*/
|
||||
public abstract void playDtmfTone(String callId, char digit);
|
||||
/** @hide */
|
||||
protected abstract void playDtmfTone(String callId, char digit);
|
||||
|
||||
/**
|
||||
* Stops any dual-tone multi-frequency sinaling (DTMF) tone currently playing.
|
||||
*
|
||||
* DTMF tones are played by calling {@link #playDtmfTone(String,char)}. If no DTMF tone is
|
||||
* currently playing, this method will do nothing.
|
||||
*
|
||||
* @param callId The unique ID of the call in which any currently playing tone will be stopped.
|
||||
*/
|
||||
public abstract void stopDtmfTone(String callId);
|
||||
/** @hide */
|
||||
protected abstract void stopDtmfTone(String callId);
|
||||
|
||||
/**
|
||||
* Called when the audio state changes.
|
||||
*
|
||||
* @param activeCallId The identifier of the call that was active during the state change.
|
||||
* @param audioState The new {@link CallAudioState}.
|
||||
*/
|
||||
public abstract void onAudioStateChanged(String activeCallId, CallAudioState audioState);
|
||||
/** @hide */
|
||||
protected abstract void onAudioStateChanged(String activeCallId, CallAudioState audioState);
|
||||
|
||||
/**
|
||||
* Conferences the specified call.
|
||||
*
|
||||
* @param conferenceCallId The unique ID of the conference call onto which the specified calls
|
||||
* should be added.
|
||||
* @param callId The call to conference.
|
||||
* @hide
|
||||
*/
|
||||
public abstract void conference(String conferenceCallId, String callId);
|
||||
/** @hide */
|
||||
protected abstract void conference(String conferenceCallId, String callId);
|
||||
|
||||
/**
|
||||
* Removes the specified call from a conference call.
|
||||
*
|
||||
* @param callId The call to remove from the conference call
|
||||
* @hide
|
||||
*/
|
||||
public abstract void splitFromConference(String callId);
|
||||
/** @hide */
|
||||
protected abstract void splitFromConference(String callId);
|
||||
|
||||
public void onPostDialContinue(String callId, boolean proceed) {}
|
||||
/** @hide */
|
||||
protected abstract void onPostDialContinue(String callId, boolean proceed);
|
||||
|
||||
public void onPostDialWait(Connection conn, String remaining) {}
|
||||
/** @hide */
|
||||
protected abstract void onFeaturesChanged(String callId, int features);
|
||||
|
||||
/**
|
||||
* Called when changes to the features of a call occurs. Features are defined in
|
||||
* {@link android.telecomm.CallFeatures}. The active features for the call are represented as
|
||||
* bits in the features bit-mask.
|
||||
*
|
||||
* @param callId The call to set the features for.
|
||||
* @param features The new features of the call.
|
||||
*/
|
||||
public abstract void onFeaturesChanged(String callId, int features);
|
||||
/** @hide */
|
||||
protected abstract void onPhoneAccountClicked(String callId);
|
||||
}
|
||||
|
||||
@@ -33,8 +33,9 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* Provides methods for ICallService implementations to interact with the system phone app.
|
||||
* TODO(santoscordon): Need final public-facing comments in this file.
|
||||
* TODO(santoscordon): Rename this to CallServiceAdapterDemultiplexer (or something).
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public final class CallServiceAdapter implements DeathRecipient {
|
||||
private final Set<ICallServiceAdapter> mAdapters = new HashSet<>();
|
||||
@@ -297,20 +298,6 @@ public final class CallServiceAdapter implements DeathRecipient {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Instructs Telecomm to handoff the call to another call service.
|
||||
*
|
||||
* @param callId The identifier of the call to handoff.
|
||||
*/
|
||||
public void handoffCall(String callId) {
|
||||
for (ICallServiceAdapter adapter : mAdapters) {
|
||||
try {
|
||||
adapter.handoffCall(callId);
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates that a new conference call has been created.
|
||||
*
|
||||
|
||||
@@ -611,6 +611,12 @@ public abstract class Connection {
|
||||
*/
|
||||
protected void onChildrenChanged(List<Connection> children) {}
|
||||
|
||||
/**
|
||||
* Called when the phone account UI was clicked.
|
||||
*/
|
||||
protected void onPhoneAccountClicked() {}
|
||||
|
||||
|
||||
private void addChild(Connection connection) {
|
||||
Log.d(this, "adding child %s", connection);
|
||||
mChildConnections.add(connection);
|
||||
|
||||
@@ -180,7 +180,7 @@ public abstract class ConnectionService extends CallService {
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final void call(final CallInfo callInfo) {
|
||||
protected final void call(final CallInfo callInfo) {
|
||||
Log.d(this, "call %s", callInfo);
|
||||
onCreateConnections(
|
||||
new ConnectionRequest(
|
||||
@@ -211,14 +211,14 @@ public abstract class ConnectionService extends CallService {
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final void abort(String callId) {
|
||||
protected final void abort(String callId) {
|
||||
Log.d(this, "abort %s", callId);
|
||||
findConnectionForAction(callId, "abort").abort();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final void setIncomingCallId(final String callId, Bundle extras) {
|
||||
protected final void setIncomingCallId(final String callId, Bundle extras) {
|
||||
Log.d(this, "setIncomingCallId %s %s", callId, extras);
|
||||
onCreateIncomingConnection(
|
||||
new ConnectionRequest(
|
||||
@@ -261,63 +261,63 @@ public abstract class ConnectionService extends CallService {
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final void answer(String callId) {
|
||||
protected final void answer(String callId) {
|
||||
Log.d(this, "answer %s", callId);
|
||||
findConnectionForAction(callId, "answer").answer();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final void reject(String callId) {
|
||||
protected final void reject(String callId) {
|
||||
Log.d(this, "reject %s", callId);
|
||||
findConnectionForAction(callId, "reject").reject();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final void disconnect(String callId) {
|
||||
protected final void disconnect(String callId) {
|
||||
Log.d(this, "disconnect %s", callId);
|
||||
findConnectionForAction(callId, "disconnect").disconnect();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final void hold(String callId) {
|
||||
protected final void hold(String callId) {
|
||||
Log.d(this, "hold %s", callId);
|
||||
findConnectionForAction(callId, "hold").hold();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final void unhold(String callId) {
|
||||
protected final void unhold(String callId) {
|
||||
Log.d(this, "unhold %s", callId);
|
||||
findConnectionForAction(callId, "unhold").unhold();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final void playDtmfTone(String callId, char digit) {
|
||||
protected final void playDtmfTone(String callId, char digit) {
|
||||
Log.d(this, "playDtmfTone %s %c", callId, digit);
|
||||
findConnectionForAction(callId, "playDtmfTone").playDtmfTone(digit);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final void stopDtmfTone(String callId) {
|
||||
protected final void stopDtmfTone(String callId) {
|
||||
Log.d(this, "stopDtmfTone %s", callId);
|
||||
findConnectionForAction(callId, "stopDtmfTone").stopDtmfTone();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final void onAudioStateChanged(String callId, CallAudioState audioState) {
|
||||
protected final void onAudioStateChanged(String callId, CallAudioState audioState) {
|
||||
Log.d(this, "onAudioStateChanged %s %s", callId, audioState);
|
||||
findConnectionForAction(callId, "onAudioStateChanged").setAudioState(audioState);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final void conference(final String conferenceCallId, String callId) {
|
||||
protected final void conference(final String conferenceCallId, String callId) {
|
||||
Log.d(this, "conference %s, %s", conferenceCallId, callId);
|
||||
|
||||
Connection connection = findConnectionForAction(callId, "conference");
|
||||
@@ -352,7 +352,7 @@ public abstract class ConnectionService extends CallService {
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final void splitFromConference(String callId) {
|
||||
protected final void splitFromConference(String callId) {
|
||||
Log.d(this, "splitFromConference(%s)", callId);
|
||||
|
||||
Connection connection = findConnectionForAction(callId, "splitFromConference");
|
||||
@@ -366,7 +366,7 @@ public abstract class ConnectionService extends CallService {
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public final void onPostDialContinue(String callId, boolean proceed) {
|
||||
protected final void onPostDialContinue(String callId, boolean proceed) {
|
||||
Log.d(this, "onPostDialContinue(%s)", callId);
|
||||
|
||||
Connection connection = findConnectionForAction(callId, "onPostDialContinue");
|
||||
@@ -377,9 +377,21 @@ public abstract class ConnectionService extends CallService {
|
||||
connection.onPostDialContinue(proceed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
/** @hide */
|
||||
@Override
|
||||
protected final void onFeaturesChanged(String callId, int features) {
|
||||
Log.d(this, "onFeaturesChanged %s %d", callId, features);
|
||||
findConnectionForAction(callId, "onFeaturesChanged").setFeatures(features);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
protected void onPhoneAccountClicked(String callId) {
|
||||
Log.d(this, "onPhoneAccountClicked %s", callId);
|
||||
findConnectionForAction(callId, "onPhoneAccountClicked").onPhoneAccountClicked();
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
protected final void onAdapterAttached(CallServiceAdapter adapter) {
|
||||
if (mAreAccountsInitialized) {
|
||||
@@ -569,18 +581,4 @@ public abstract class ConnectionService extends CallService {
|
||||
Log.w(this, "%s - Cannot find Connection %s", action, callId);
|
||||
return NULL_CONNECTION;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles changes to the features of a connection.
|
||||
* Features are defined in {@link android.telecomm.CallFeatures} and are passed in as a
|
||||
* bit-mask.
|
||||
*
|
||||
* @param callId The call to set the features for.
|
||||
* @param features The new features of the call.
|
||||
*/
|
||||
@Override
|
||||
public final void onFeaturesChanged(String callId, int features) {
|
||||
Log.d(this, "onFeaturesChanged %s %d", callId, features);
|
||||
findConnectionForAction(callId, "onFeaturesChanged").setFeatures(features);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,13 +189,13 @@ public final class InCallAdapter {
|
||||
}
|
||||
|
||||
/**
|
||||
* Instructs Telecomm to handoff the call to another call service.
|
||||
* Instructs Telecomm that the phone account UI was clicked.
|
||||
*
|
||||
* @param callId The identifier of the call to handoff.
|
||||
* @param callId The identifier of the call.
|
||||
*/
|
||||
public void handoffCall(String callId) {
|
||||
public void phoneAccountClicked(String callId) {
|
||||
try {
|
||||
mAdapter.handoffCall(callId);
|
||||
mAdapter.phoneAccountClicked(callId);
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ public final class InCallCall implements Parcelable {
|
||||
private final GatewayInfo mGatewayInfo;
|
||||
private final PhoneAccount mAccount;
|
||||
private final CallServiceDescriptor mCurrentCallServiceDescriptor;
|
||||
private final CallServiceDescriptor mHandoffCallServiceDescriptor;
|
||||
private final ICallVideoProvider mCallVideoProvider;
|
||||
private RemoteCallVideoProvider mRemoteCallVideoProvider;
|
||||
private final String mParentCallId;
|
||||
@@ -61,9 +60,8 @@ public final class InCallCall implements Parcelable {
|
||||
long connectTimeMillis,
|
||||
Uri handle,
|
||||
GatewayInfo gatewayInfo,
|
||||
PhoneAccount subscription,
|
||||
PhoneAccount account,
|
||||
CallServiceDescriptor descriptor,
|
||||
CallServiceDescriptor handoffDescriptor,
|
||||
ICallVideoProvider callVideoProvider,
|
||||
String parentCallId,
|
||||
List<String> childCallIds,
|
||||
@@ -77,9 +75,8 @@ public final class InCallCall implements Parcelable {
|
||||
mConnectTimeMillis = connectTimeMillis;
|
||||
mHandle = handle;
|
||||
mGatewayInfo = gatewayInfo;
|
||||
mAccount = subscription;
|
||||
mAccount = account;
|
||||
mCurrentCallServiceDescriptor = descriptor;
|
||||
mHandoffCallServiceDescriptor = handoffDescriptor;
|
||||
mCallVideoProvider = callVideoProvider;
|
||||
mParentCallId = parentCallId;
|
||||
mChildCallIds = childCallIds;
|
||||
@@ -149,14 +146,6 @@ public final class InCallCall implements Parcelable {
|
||||
return mCurrentCallServiceDescriptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* The descriptor for the call service that this call is being switched to, null if handoff is
|
||||
* not in progress.
|
||||
*/
|
||||
public CallServiceDescriptor getHandoffCallServiceDescriptor() {
|
||||
return mHandoffCallServiceDescriptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an object for remotely communicating through the call video provider's binder.
|
||||
* @return The call video provider.
|
||||
@@ -217,7 +206,6 @@ public final class InCallCall implements Parcelable {
|
||||
GatewayInfo gatewayInfo = source.readParcelable(classLoader);
|
||||
PhoneAccount account = source.readParcelable(classLoader);
|
||||
CallServiceDescriptor descriptor = source.readParcelable(classLoader);
|
||||
CallServiceDescriptor handoffDescriptor = source.readParcelable(classLoader);
|
||||
ICallVideoProvider callVideoProvider =
|
||||
ICallVideoProvider.Stub.asInterface(source.readStrongBinder());
|
||||
String parentCallId = source.readString();
|
||||
@@ -226,8 +214,7 @@ public final class InCallCall implements Parcelable {
|
||||
int features = source.readInt();
|
||||
return new InCallCall(id, state, disconnectCauseCode, disconnectCauseMsg,
|
||||
cannedSmsResponses, capabilities, connectTimeMillis, handle, gatewayInfo,
|
||||
account, descriptor, handoffDescriptor, callVideoProvider, parentCallId,
|
||||
childCallIds, features);
|
||||
account, descriptor, callVideoProvider, parentCallId, childCallIds, features);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -256,7 +243,6 @@ public final class InCallCall implements Parcelable {
|
||||
destination.writeParcelable(mGatewayInfo, 0);
|
||||
destination.writeParcelable(mAccount, 0);
|
||||
destination.writeParcelable(mCurrentCallServiceDescriptor, 0);
|
||||
destination.writeParcelable(mHandoffCallServiceDescriptor, 0);
|
||||
destination.writeStrongBinder(
|
||||
mCallVideoProvider != null ? mCallVideoProvider.asBinder() : null);
|
||||
destination.writeString(mParentCallId);
|
||||
|
||||
@@ -176,12 +176,6 @@ public final class RemoteConnectionService implements DeathRecipient {
|
||||
}
|
||||
}
|
||||
|
||||
/** ${inheritDoc} */
|
||||
@Override
|
||||
public void handoffCall(String connectionId) {
|
||||
// unnecessary.
|
||||
}
|
||||
|
||||
/** ${inheritDoc} */
|
||||
@Override
|
||||
public void queryRemoteConnectionServices(RemoteServiceCallback callback) {
|
||||
|
||||
@@ -27,13 +27,13 @@ public final class TelecommConstants {
|
||||
/**
|
||||
* <p>Activity action: Starts the UI for handing an incoming call. This intent starts the
|
||||
* in-call UI by notifying the Telecomm system that an incoming call exists for a specific call
|
||||
* service (see {@link android.telecomm.CallService}). Telecomm reads the Intent extras to find
|
||||
* and bind to the appropriate {@link android.telecomm.CallService} which Telecomm will
|
||||
* ultimately use to control and get information about the call.</p>
|
||||
* service (see {@link android.telecomm.ConnectionService}). Telecomm reads the Intent extras
|
||||
* to find and bind to the appropriate {@link android.telecomm.ConnectionService} which
|
||||
* Telecomm will ultimately use to control and get information about the call.</p>
|
||||
*
|
||||
* <p>Input: get*Extra field {@link #EXTRA_CALL_SERVICE_DESCRIPTOR} contains the component name
|
||||
* of the {@link android.telecomm.CallService} that Telecomm should bind to. Telecomm will then
|
||||
* ask the call service for more information about the call prior to showing any UI.
|
||||
* of the {@link android.telecomm.ConnectionService} that Telecomm should bind to. Telecomm
|
||||
* will then ask the call service for more information about the call prior to showing any UI.
|
||||
*
|
||||
* TODO(santoscordon): Needs permissions.
|
||||
* TODO(santoscordon): Consider moving this into a simple method call on a system service.
|
||||
@@ -46,7 +46,7 @@ public final class TelecommConstants {
|
||||
public static final String ACTION_CALL_SERVICE_PROVIDER = CallServiceProvider.class.getName();
|
||||
|
||||
/**
|
||||
* The service action used to bind to {@link CallService} implementations.
|
||||
* The service action used to bind to {@link ConnectionService} implementations.
|
||||
*/
|
||||
public static final String ACTION_CALL_SERVICE = CallService.class.getName();
|
||||
|
||||
@@ -73,8 +73,8 @@ public final class TelecommConstants {
|
||||
|
||||
/**
|
||||
* 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)}.
|
||||
* metadata about the call. This {@link Bundle} will be returned to the
|
||||
* {@link ConnectionService}.
|
||||
*/
|
||||
public static final String EXTRA_INCOMING_CALL_EXTRAS =
|
||||
"android.intent.extra.INCOMING_CALL_EXTRAS";
|
||||
|
||||
@@ -59,4 +59,6 @@ oneway interface ICallService {
|
||||
void splitFromConference(String callId);
|
||||
|
||||
void onPostDialContinue(String callId, boolean proceed);
|
||||
|
||||
void onPhoneAccountClicked(String callId);
|
||||
}
|
||||
|
||||
@@ -60,8 +60,6 @@ oneway interface ICallServiceAdapter {
|
||||
|
||||
void onPostDialWait(String callId, String remaining);
|
||||
|
||||
void handoffCall(String callId);
|
||||
|
||||
void queryRemoteConnectionServices(RemoteServiceCallback callback);
|
||||
|
||||
void setCallVideoProvider(String callId, ICallVideoProvider callVideoProvider);
|
||||
|
||||
@@ -46,7 +46,7 @@ oneway interface IInCallAdapter {
|
||||
|
||||
void postDialContinue(String callId, boolean proceed);
|
||||
|
||||
void handoffCall(String callId);
|
||||
void phoneAccountClicked(String callId);
|
||||
|
||||
void conference(String callId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user