Refactor CallScreeningService's internal structure

Use a single AIDL method and perform logic in Telecom instead of slicing
up the call response on the client side.

Also pass through the call response to the connection service.

Bug: 179412110
Test: atest ConnectionServiceTest CallScreeningServiceTest
Change-Id: I878c0ce34142da104dc0e2795487b03a6bdacb5f
This commit is contained in:
Hall Liu
2021-02-04 13:09:45 -08:00
parent 191b3b9db5
commit 5efe997539
8 changed files with 215 additions and 38 deletions

View File

@@ -3390,11 +3390,20 @@ public abstract class Connection extends Conferenceable {
* {@code true}, {@link #onDisconnect()} will be called soon after
* this is called.
* @param isInContacts Indicates whether the caller is in the user's contacts list.
* @param callScreeningResponse The response that was returned from the
* {@link CallScreeningService} that handled this call. If no
* response was received from a call screening service,
* this will be {@code null}.
* @param isResponseFromSystemDialer Whether {@code callScreeningResponse} was sent from the
* system dialer. If {@code callScreeningResponse} is
* {@code null}, this will be {@code false}.
* @hide
*/
@SystemApi
@RequiresPermission(Manifest.permission.READ_CONTACTS)
public void onCallFilteringCompleted(boolean isBlocked, boolean isInContacts) { }
public void onCallFilteringCompleted(boolean isBlocked, boolean isInContacts,
@Nullable CallScreeningService.CallResponse callScreeningResponse,
boolean isResponseFromSystemDialer) { }
static String toLogSafePhoneNumber(String number) {
// For unknown number, log empty string.