diff options
author | Hall Liu <hallliu@google.com> | 2021-02-04 13:09:45 -0800 |
---|---|---|
committer | Hall Liu <hallliu@google.com> | 2021-02-12 14:04:10 -0800 |
commit | 5efe99753969b0f4991e05830c4f6cc26bd1c2e1 (patch) | |
tree | b125257091f7ae96bc90adc06c264f8809fbc176 /telecomm/java/android/telecom/ConnectionService.java | |
parent | 191b3b9db547b603b636aa3a9ce4db672401952e (diff) |
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
Diffstat (limited to 'telecomm/java/android/telecom/ConnectionService.java')
-rwxr-xr-x | telecomm/java/android/telecom/ConnectionService.java | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index 3b06fd3d4ea1..d9b108b70d51 100755 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -759,6 +759,8 @@ public abstract class ConnectionService extends Service { @Override public void onCallFilteringCompleted(String callId, boolean isBlocked, boolean isInContacts, + CallScreeningService.ParcelableCallResponse callScreeningResponse, + boolean isResponseFromSystemDialer, Session.Info sessionInfo) { Log.startSession(sessionInfo, SESSION_CALL_FILTERING_COMPLETED); try { @@ -766,7 +768,9 @@ public abstract class ConnectionService extends Service { args.arg1 = callId; args.arg2 = isBlocked; args.arg3 = isInContacts; - args.arg4 = Log.createSubsession(); + args.arg4 = callScreeningResponse; + args.arg5 = isResponseFromSystemDialer; + args.arg6 = Log.createSubsession(); mHandler.obtainMessage(MSG_ON_CALL_FILTERING_COMPLETED, args).sendToTarget(); } finally { Log.endSession(); @@ -1437,12 +1441,16 @@ public abstract class ConnectionService extends Service { case MSG_ON_CALL_FILTERING_COMPLETED: { SomeArgs args = (SomeArgs) msg.obj; try { - Log.continueSession((Session) args.arg4, + Log.continueSession((Session) args.arg6, SESSION_HANDLER + SESSION_CALL_FILTERING_COMPLETED); String callId = (String) args.arg1; boolean isBlocked = (boolean) args.arg2; boolean isInContacts = (boolean) args.arg3; - onCallFilteringCompleted(callId, isBlocked, isInContacts); + CallScreeningService.ParcelableCallResponse callScreeningResponse = + (CallScreeningService.ParcelableCallResponse) args.arg4; + boolean isResponseFromSystemDialer = (boolean) args.arg5; + onCallFilteringCompleted(callId, isBlocked, isInContacts, + callScreeningResponse, isResponseFromSystemDialer); } finally { args.recycle(); Log.endSession(); @@ -2458,11 +2466,16 @@ public abstract class ConnectionService extends Service { } } - private void onCallFilteringCompleted(String callId, boolean isBlocked, boolean isInContacts) { - Log.i(this, "onCallFilteringCompleted(%b, %b)", isBlocked, isInContacts); + private void onCallFilteringCompleted(String callId, boolean isBlocked, boolean isInContacts, + CallScreeningService.ParcelableCallResponse callScreeningResponse, + boolean isResponseFromSystemDialer) { + Log.i(this, "onCallFilteringCompleted(%s, %b, %b, %s, %b)", callId, + isBlocked, isInContacts, callScreeningResponse, isResponseFromSystemDialer); Connection connection = findConnectionForAction(callId, "onCallFilteringCompleted"); if (connection != null) { - connection.onCallFilteringCompleted(isBlocked, isInContacts); + connection.onCallFilteringCompleted(isBlocked, isInContacts, + callScreeningResponse == null ? null : callScreeningResponse.toCallResponse(), + isResponseFromSystemDialer); } } |