Merge "API review: Telecom outgoing call Call redirection API" am: bac4d5b257

am: bcd431fd2f

Change-Id: Ib8f4bd78be6f47a489278359bb2838e6d1a4bbe6
This commit is contained in:
sqian
2019-03-14 19:34:59 -07:00
committed by android-build-merger

View File

@@ -62,16 +62,20 @@ public abstract class CallRedirectionService extends Service {
private ICallRedirectionAdapter mCallRedirectionAdapter;
/**
* Telecom calls this method to inform the implemented {@link CallRedirectionService} of
* a new outgoing call which is being placed. Telecom does not request to redirect emergency
* calls and does not request to redirect calls with gateway information.
* Telecom calls this method once upon binding to a {@link CallRedirectionService} to inform
* it of a new outgoing call which is being placed. Telecom does not request to redirect
* emergency calls and does not request to redirect calls with gateway information.
*
* <p>Telecom will cancel the call if Telecom does not receive a response in 5 seconds from
* the implemented {@link CallRedirectionService} set by users.
*
* <p>The implemented {@link CallRedirectionService} can call {@link #placeCallUnmodified()},
* {@link #redirectCall(Uri, PhoneAccountHandle, boolean)}, and {@link #cancelCall()} only
* from here.
* from here. Calls to these methods are assumed by the Telecom framework to be the response
* for the phone call for which {@link #onPlaceCall(Uri, PhoneAccountHandle, boolean)} was
* invoked by Telecom. The Telecom framework will only invoke
* {@link #onPlaceCall(Uri, PhoneAccountHandle, boolean)} once each time it binds to a
* {@link CallRedirectionService}.
*
* @param handle the phone number dialed by the user, represented in E.164 format if possible
* @param initialPhoneAccount the {@link PhoneAccountHandle} on which the call will be placed.
@@ -91,13 +95,15 @@ public abstract class CallRedirectionService extends Service {
* no changes are required to the outgoing call, and that the call should be placed as-is.
*
* <p>This can only be called from implemented
* {@link #onPlaceCall(Uri, PhoneAccountHandle, boolean)}.
* {@link #onPlaceCall(Uri, PhoneAccountHandle, boolean)}. The response corresponds to the
* latest request via {@link #onPlaceCall(Uri, PhoneAccountHandle, boolean)}.
*
*/
public final void placeCallUnmodified() {
try {
mCallRedirectionAdapter.placeCallUnmodified();
} catch (RemoteException e) {
e.rethrowAsRuntimeException();
}
}
@@ -109,7 +115,8 @@ public abstract class CallRedirectionService extends Service {
* replies Telecom a handle for an emergency number.
*
* <p>This can only be called from implemented
* {@link #onPlaceCall(Uri, PhoneAccountHandle, boolean)}.
* {@link #onPlaceCall(Uri, PhoneAccountHandle, boolean)}. The response corresponds to the
* latest request via {@link #onPlaceCall(Uri, PhoneAccountHandle, boolean)}.
*
* @param handle the new phone number to dial
* @param targetPhoneAccount the {@link PhoneAccountHandle} to use when placing the call.
@@ -126,6 +133,7 @@ public abstract class CallRedirectionService extends Service {
try {
mCallRedirectionAdapter.redirectCall(handle, targetPhoneAccount, confirmFirst);
} catch (RemoteException e) {
e.rethrowAsRuntimeException();
}
}
@@ -135,13 +143,15 @@ public abstract class CallRedirectionService extends Service {
* an outgoing call should be canceled entirely.
*
* <p>This can only be called from implemented
* {@link #onPlaceCall(Uri, PhoneAccountHandle, boolean)}.
* {@link #onPlaceCall(Uri, PhoneAccountHandle, boolean)}. The response corresponds to the
* latest request via {@link #onPlaceCall(Uri, PhoneAccountHandle, boolean)}.
*
*/
public final void cancelCall() {
try {
mCallRedirectionAdapter.cancelCall();
} catch (RemoteException e) {
e.rethrowAsRuntimeException();
}
}