Merge "Expose post-dial APIs" into lmp-preview-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e62a885ea6
@@ -63,6 +63,7 @@ public abstract class CallService extends Service {
|
||||
private static final int MSG_STOP_DTMF_TONE = 13;
|
||||
private static final int MSG_ADD_TO_CONFERENCE = 14;
|
||||
private static final int MSG_SPLIT_FROM_CONFERENCE = 15;
|
||||
private static final int MSG_ON_POST_DIAL_CONTINUE = 16;
|
||||
|
||||
/**
|
||||
* Default Handler used to consolidate binder method calls onto a single thread.
|
||||
@@ -150,6 +151,17 @@ public abstract class CallService extends Service {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MSG_ON_POST_DIAL_CONTINUE: {
|
||||
SomeArgs args = (SomeArgs) msg.obj;
|
||||
try {
|
||||
String callId = (String) args.arg1;
|
||||
boolean proceed = (args.argi1 == 1);
|
||||
onPostDialContinue(callId, proceed);
|
||||
} finally {
|
||||
args.recycle();
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -247,6 +259,14 @@ public abstract class CallService extends Service {
|
||||
args.arg2 = callId;
|
||||
mMessageHandler.obtainMessage(MSG_SPLIT_FROM_CONFERENCE, args).sendToTarget();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostDialContinue(String callId, boolean proceed) {
|
||||
SomeArgs args = SomeArgs.obtain();
|
||||
args.arg1 = callId;
|
||||
args.argi1 = proceed ? 1 : 0;
|
||||
mMessageHandler.obtainMessage(MSG_ON_POST_DIAL_CONTINUE, args).sendToTarget();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -422,4 +442,7 @@ public abstract class CallService extends Service {
|
||||
* @hide
|
||||
*/
|
||||
public abstract void splitFromConference(String conferenceCallId, String callId);
|
||||
|
||||
public void onPostDialContinue(String callId, boolean proceed) {}
|
||||
public void onPostDialWait(Connection conn, String remaining) {}
|
||||
}
|
||||
|
||||
@@ -217,4 +217,11 @@ public final class CallServiceAdapter {
|
||||
} catch (RemoteException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
public void onPostDialWait(String callId, String remaining) {
|
||||
try {
|
||||
mAdapter.onPostDialWait(callId, remaining);
|
||||
} catch (RemoteException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,6 +444,11 @@ public abstract class Connection {
|
||||
*/
|
||||
protected void onReject() {}
|
||||
|
||||
/**
|
||||
* Notifies this Connection whether the user wishes to proceed with the post-dial DTMF codes.
|
||||
*/
|
||||
protected void onPostDialContinue(boolean proceed) {}
|
||||
|
||||
private void setState(int state) {
|
||||
Log.d(this, "setState: %s", stateToString(state));
|
||||
onSetState(state);
|
||||
|
||||
@@ -146,7 +146,8 @@ public abstract class ConnectionService extends CallService {
|
||||
}
|
||||
} else {
|
||||
addConnection(callInfo.getId(), result[0]);
|
||||
Log.d(this, "adapter handleSuccessfulOutgoingCall %s", callInfo.getId());
|
||||
Log.d(this, "adapter handleSuccessfulOutgoingCall %s",
|
||||
callInfo.getId());
|
||||
getAdapter().handleSuccessfulOutgoingCall(callInfo.getId());
|
||||
}
|
||||
}
|
||||
@@ -288,6 +289,25 @@ public abstract class ConnectionService extends CallService {
|
||||
// TODO(santoscordon): Find existing conference call and invoke split(connection).
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onPostDialContinue(String callId, boolean proceed) {
|
||||
Log.d(this, "onPostDialContinue(%s)", callId);
|
||||
|
||||
Connection connection = findConnectionForAction(callId, "onPostDialContinue");
|
||||
if (connection == NULL_CONNECTION) {
|
||||
Log.w(this, "Connection missing in post-dial request %s.", callId);
|
||||
return;
|
||||
}
|
||||
connection.onPostDialContinue(proceed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onPostDialWait(Connection conn, String remaining) {
|
||||
Log.d(this, "onPostDialWait(%s, %s)", conn, remaining);
|
||||
|
||||
getAdapter().onPostDialWait(mIdByConnection.get(conn), remaining);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a set of Subscriptions matching a given handle (e.g. phone number).
|
||||
*
|
||||
|
||||
@@ -174,13 +174,14 @@ public final class InCallAdapter {
|
||||
* will pause playing the tones and notify the {@link InCallService} that the call is in the
|
||||
* {@link InCallService#setPostDialWait(String,String)} state. When the user decides to continue
|
||||
* the postdial sequence, the {@link InCallService} should invoke the
|
||||
* {@link #postDialContinue(String)} method.
|
||||
* {@link #postDialContinue(String,boolean)} method.
|
||||
*
|
||||
* @param callId The unique ID of the call for which postdial string playing should continue.
|
||||
* @param proceed Whether or not to continue with the post-dial sequence.
|
||||
*/
|
||||
public void postDialContinue(String callId) {
|
||||
public void postDialContinue(String callId, boolean proceed) {
|
||||
try {
|
||||
mAdapter.postDialContinue(callId);
|
||||
mAdapter.postDialContinue(callId, proceed);
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,4 +59,6 @@ oneway interface ICallService {
|
||||
void addToConference(String conferenceCallId, in List<String> callIds);
|
||||
|
||||
void splitFromConference(String conferenceCallId, String callId);
|
||||
|
||||
void onPostDialContinue(String callId, boolean proceed);
|
||||
}
|
||||
|
||||
@@ -52,4 +52,6 @@ oneway interface ICallServiceAdapter {
|
||||
void setIsConferenced(String conferenceCallId, String callId, boolean isConferenced);
|
||||
|
||||
void removeCall(String callId);
|
||||
|
||||
void onPostDialWait(String callId, String remaining);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ oneway interface IInCallAdapter {
|
||||
|
||||
void stopDtmfTone(String callId);
|
||||
|
||||
void postDialContinue(String callId);
|
||||
void postDialContinue(String callId, boolean proceed);
|
||||
|
||||
void handoffCall(String callId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user