summaryrefslogtreecommitdiff
path: root/telecomm/java/android/telecom/ConnectionService.java
diff options
context:
space:
mode:
authorHall Liu <hallliu@google.com>2021-01-15 11:41:48 -0800
committerHall Liu <hallliu@google.com>2021-01-15 17:52:37 -0800
commit49cabccc17920a7adb60b74e95c50e776e08ec99 (patch)
tree9cb192254fe27980204676280d46a1d18ba10b87 /telecomm/java/android/telecom/ConnectionService.java
parentcae6ddb11d77cfc34abb5fb895b8b1361f67a414 (diff)
Add API to inform Telephony that call filtering is complete
Add an API that gets called once call filtering finishes. Meant to trigger download of call composer images. Bug: 177613111 Test: atest ConnectionServiceTest Change-Id: I4e06f19c859022ddb933f697dde13e459a3d354e
Diffstat (limited to 'telecomm/java/android/telecom/ConnectionService.java')
-rwxr-xr-xtelecomm/java/android/telecom/ConnectionService.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index b1ccb533e83d..f86f9d5dad3d 100755
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -147,6 +147,7 @@ public abstract class ConnectionService extends Service {
private static final String SESSION_POST_DIAL_CONT = "CS.oPDC";
private static final String SESSION_PULL_EXTERNAL_CALL = "CS.pEC";
private static final String SESSION_SEND_CALL_EVENT = "CS.sCE";
+ private static final String SESSION_CALL_FILTERING_COMPLETED = "CS.oCFC";
private static final String SESSION_HANDOVER_COMPLETE = "CS.hC";
private static final String SESSION_EXTRAS_CHANGED = "CS.oEC";
private static final String SESSION_START_RTT = "CS.+RTT";
@@ -200,6 +201,7 @@ public abstract class ConnectionService extends Service {
private static final int MSG_ADD_PARTICIPANT = 39;
private static final int MSG_EXPLICIT_CALL_TRANSFER = 40;
private static final int MSG_EXPLICIT_CALL_TRANSFER_CONSULTATIVE = 41;
+ private static final int MSG_ON_CALL_FILTERING_COMPLETED = 42;
private static Connection sNullConnection;
@@ -722,6 +724,22 @@ public abstract class ConnectionService extends Service {
}
@Override
+ public void onCallFilteringCompleted(String callId, boolean isBlocked, boolean isInContacts,
+ Session.Info sessionInfo) {
+ Log.startSession(sessionInfo, SESSION_CALL_FILTERING_COMPLETED);
+ try {
+ SomeArgs args = SomeArgs.obtain();
+ args.arg1 = callId;
+ args.arg2 = isBlocked;
+ args.arg3 = isInContacts;
+ args.arg4 = Log.createSubsession();
+ mHandler.obtainMessage(MSG_ON_CALL_FILTERING_COMPLETED, args).sendToTarget();
+ } finally {
+ Log.endSession();
+ }
+ }
+
+ @Override
public void onExtrasChanged(String callId, Bundle extras, Session.Info sessionInfo) {
Log.startSession(sessionInfo, SESSION_EXTRAS_CHANGED);
try {
@@ -1354,6 +1372,21 @@ public abstract class ConnectionService extends Service {
}
break;
}
+ case MSG_ON_CALL_FILTERING_COMPLETED: {
+ SomeArgs args = (SomeArgs) msg.obj;
+ try {
+ Log.continueSession((Session) args.arg4,
+ 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);
+ } finally {
+ args.recycle();
+ Log.endSession();
+ }
+ break;
+ }
case MSG_HANDOVER_COMPLETE: {
SomeArgs args = (SomeArgs) msg.obj;
try {
@@ -2345,6 +2378,14 @@ public abstract class ConnectionService extends Service {
}
}
+ private void onCallFilteringCompleted(String callId, boolean isBlocked, boolean isInContacts) {
+ Log.i(this, "onCallFilteringCompleted(%s, %b, %b)", isBlocked, isInContacts);
+ Connection connection = findConnectionForAction(callId, "onCallFilteringCompleted");
+ if (connection != null) {
+ connection.onCallFilteringCompleted(isBlocked, isInContacts);
+ }
+ }
+
/**
* Notifies a {@link Connection} that a handover has completed.
*