Add support for rejecting Telecom call with a specified reason.

Adding a new Call API which supports passing a user-specified call
rejection reason down to the lower layers for reporting to the network.
Part of the VERSTAT spec involves support for this type of signaling, so
it makes sense to also support it here as well.
There are two potential types of reject reason:
declined - user declined the call because they want it to go to voicemail
or don't want to talk to the caller right now.
unwanted - this is a nuisance call and the user never wanted to receive it.

Bug: 135929421
Test: Added new CTS test to validate API pathways.
Test: Ran existing telecom and telephony unit tests.
Test: Modified test dialer app to use the new reject API and verified that
the reject reason signals down to the modem and translates to the correct
reject cause.

Change-Id: I6f25fafa2b2620e2839e5d3a9fb986f1130fa165
This commit is contained in:
Tyler Gunn
2020-01-23 13:10:37 -08:00
parent 0ab00030a2
commit facfdee122
8 changed files with 104 additions and 0 deletions

View File

@@ -3036,6 +3036,17 @@ public abstract class Connection extends Conferenceable {
*/
public void onReject() {}
/**
* Notifies this Connection, which is in {@link #STATE_RINGING}, of a request to reject.
* <p>
* For managed {@link ConnectionService}s, this will be called when the user rejects a call via
* the default dialer's {@link InCallService} using {@link Call#reject(int)}.
* @param rejectReason the reason the user provided for rejecting the call.
*/
public void onReject(@android.telecom.Call.RejectReason int rejectReason) {
// to be implemented by ConnectionService.
}
/**
* Notifies this Connection, which is in {@link #STATE_RINGING}, of
* a request to reject with a message.