blob: 7988b036ccd3afc16c49d540bf56a254aa3f5fa0 [file] [log] [blame]
Sailesh Nepal1bef3392016-01-24 18:21:53 -08001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
15 */
16
17package android.telecom;
18
Hall Liuff4a1252020-01-01 16:27:14 -080019import android.Manifest;
Tyler Gunn7e45b722018-12-04 12:56:45 -080020import android.annotation.NonNull;
Hall Liuff4a1252020-01-01 16:27:14 -080021import android.annotation.RequiresPermission;
Sailesh Nepal1bef3392016-01-24 18:21:53 -080022import android.annotation.SdkConstant;
Hall Liu6dfa2492019-10-01 17:20:39 -070023import android.annotation.SystemApi;
Sailesh Nepal1bef3392016-01-24 18:21:53 -080024import android.app.Service;
tonyzhu9e1d4f82018-10-22 15:11:31 +080025import android.content.ComponentName;
Sailesh Nepal1bef3392016-01-24 18:21:53 -080026import android.content.Intent;
Tyler Gunn460b7d42020-05-15 10:19:32 -070027import android.content.pm.ServiceInfo;
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -080028import android.net.Uri;
Sailesh Nepal1bef3392016-01-24 18:21:53 -080029import android.os.Handler;
30import android.os.IBinder;
31import android.os.Looper;
32import android.os.Message;
33import android.os.RemoteException;
34
35import com.android.internal.os.SomeArgs;
Sailesh Nepal1bef3392016-01-24 18:21:53 -080036import com.android.internal.telecom.ICallScreeningAdapter;
Tyler Gunne0caec72018-11-30 14:21:18 -080037import com.android.internal.telecom.ICallScreeningService;
Sailesh Nepal1bef3392016-01-24 18:21:53 -080038
39/**
40 * This service can be implemented by the default dialer (see
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -080041 * {@link TelecomManager#getDefaultDialerPackage()}) or a third party app to allow or disallow
Tyler Gunna842e7622019-03-29 11:32:08 -070042 * incoming calls before they are shown to a user. A {@link CallScreeningService} can also see
43 * outgoing calls for the purpose of providing caller ID services for those calls.
Sailesh Nepal1bef3392016-01-24 18:21:53 -080044 * <p>
45 * Below is an example manifest registration for a {@code CallScreeningService}.
46 * <pre>
47 * {@code
48 * <service android:name="your.package.YourCallScreeningServiceImplementation"
49 * android:permission="android.permission.BIND_SCREENING_SERVICE">
50 * <intent-filter>
51 * <action android:name="android.telecom.CallScreeningService"/>
52 * </intent-filter>
53 * </service>
54 * }
55 * </pre>
Tyler Gunn7e45b722018-12-04 12:56:45 -080056 * <p>
57 * A CallScreeningService performs two functions:
58 * <ol>
59 * <li>Call blocking/screening - the service can choose which calls will ring on the user's
60 * device, and which will be silently sent to voicemail.</li>
Tyler Gunna842e7622019-03-29 11:32:08 -070061 * <li>Call identification - services which provide call identification functionality can
62 * display a user-interface of their choosing which contains identifying information for a call.
63 * </li>
Tyler Gunn7e45b722018-12-04 12:56:45 -080064 * </ol>
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -080065 * <p>
Tyler Gunn467acc42020-10-07 15:42:06 -070066 * <h2>Becoming the CallScreeningService</h2>
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -080067 * Telecom will bind to a single app chosen by the user which implements the
68 * {@link CallScreeningService} API when there are new incoming and outgoing calls.
69 * <p>
70 * The code snippet below illustrates how your app can request that it fills the call screening
71 * role.
72 * <pre>
73 * {@code
74 * private static final int REQUEST_ID = 1;
75 *
76 * public void requestRole() {
77 * RoleManager roleManager = (RoleManager) getSystemService(ROLE_SERVICE);
Grace Jia2d21e952019-09-20 14:57:00 -070078 * Intent intent = roleManager.createRequestRoleIntent(RoleManager.ROLE_CALL_SCREENING);
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -080079 * startActivityForResult(intent, REQUEST_ID);
80 * }
81 *
82 * &#64;Override
83 * public void onActivityResult(int requestCode, int resultCode, Intent data) {
84 * if (requestCode == REQUEST_ID) {
85 * if (resultCode == android.app.Activity.RESULT_OK) {
86 * // Your app is now the call screening app
87 * } else {
88 * // Your app is not the call screening app
89 * }
90 * }
91 * }
Tyler Gunn467acc42020-10-07 15:42:06 -070092 * }
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -080093 * </pre>
Tyler Gunn467acc42020-10-07 15:42:06 -070094 *
95 * <h2>CallScreeningService Lifecycle</h2>
96 *
97 * The framework binds to the {@link CallScreeningService} implemented by the user-chosen app
98 * filling the {@link android.app.role.RoleManager#ROLE_CALL_SCREENING} role when incoming calls are
99 * received (prior to ringing) and when outgoing calls are placed. The platform calls the
100 * {@link #onScreenCall(Call.Details)} method to provide your service with details about the call.
101 * <p>
102 * For incoming calls, the {@link CallScreeningService} must call
103 * {@link #respondToCall(Call.Details, CallResponse)} within 5 seconds of being bound to indicate to
104 * the platform whether the call should be blocked or not. Your app must do this even if it is
105 * primarily performing caller ID operations and not screening calls. It is important to perform
106 * screening operations in a timely matter as the user's device will not begin ringing until the
107 * response is received (or the timeout is hit). A {@link CallScreeningService} may choose to
108 * perform local database lookups to help determine if a call should be screened or not; care should
109 * be taken to ensure the timeout is not repeatedly hit, causing delays in the incoming call flow.
110 * <p>
111 * If your app provides a caller ID experience, it should launch an activity to show the caller ID
112 * information from {@link #onScreenCall(Call.Details)}.
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800113 */
114public abstract class CallScreeningService extends Service {
115 /**
116 * The {@link Intent} that must be declared as handled by the service.
117 */
118 @SdkConstant(SdkConstant.SdkConstantType.SERVICE_ACTION)
119 public static final String SERVICE_INTERFACE = "android.telecom.CallScreeningService";
120
121 private static final int MSG_SCREEN_CALL = 1;
122
123 private final Handler mHandler = new Handler(Looper.getMainLooper()) {
124 @Override
125 public void handleMessage(Message msg) {
126 switch (msg.what) {
127 case MSG_SCREEN_CALL:
128 SomeArgs args = (SomeArgs) msg.obj;
129 try {
130 mCallScreeningAdapter = (ICallScreeningAdapter) args.arg1;
Grace Jia90b38042019-11-06 14:12:33 -0800131 Call.Details callDetails = Call.Details
132 .createFromParcelableCall((ParcelableCall) args.arg2);
133 onScreenCall(callDetails);
134 if (callDetails.getCallDirection() == Call.Details.DIRECTION_OUTGOING) {
135 mCallScreeningAdapter.allowCall(callDetails.getTelecomCallId());
136 }
137 } catch (RemoteException e) {
138 Log.w(this, "Exception when screening call: " + e);
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800139 } finally {
140 args.recycle();
141 }
142 break;
143 }
144 }
145 };
146
147 private final class CallScreeningBinder extends ICallScreeningService.Stub {
148 @Override
149 public void screenCall(ICallScreeningAdapter adapter, ParcelableCall call) {
150 Log.v(this, "screenCall");
151 SomeArgs args = SomeArgs.obtain();
152 args.arg1 = adapter;
153 args.arg2 = call;
154 mHandler.obtainMessage(MSG_SCREEN_CALL, args).sendToTarget();
155 }
156 }
157
158 private ICallScreeningAdapter mCallScreeningAdapter;
159
160 /*
161 * Information about how to respond to an incoming call.
162 */
Sailesh Nepalf4460712016-01-27 16:45:51 -0800163 public static class CallResponse {
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800164 private final boolean mShouldDisallowCall;
165 private final boolean mShouldRejectCall;
Usman Abdullah47b392d2019-03-06 15:54:56 -0800166 private final boolean mShouldSilenceCall;
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800167 private final boolean mShouldSkipCallLog;
168 private final boolean mShouldSkipNotification;
Hall Liu69554cf2019-11-11 17:44:09 -0800169 private final boolean mShouldScreenCallViaAudioProcessing;
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800170
171 private CallResponse(
172 boolean shouldDisallowCall,
173 boolean shouldRejectCall,
Usman Abdullah47b392d2019-03-06 15:54:56 -0800174 boolean shouldSilenceCall,
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800175 boolean shouldSkipCallLog,
Hall Liu6dfa2492019-10-01 17:20:39 -0700176 boolean shouldSkipNotification,
Hall Liu69554cf2019-11-11 17:44:09 -0800177 boolean shouldScreenCallViaAudioProcessing) {
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800178 if (!shouldDisallowCall
179 && (shouldRejectCall || shouldSkipCallLog || shouldSkipNotification)) {
180 throw new IllegalStateException("Invalid response state for allowed call.");
181 }
182
Hall Liu69554cf2019-11-11 17:44:09 -0800183 if (shouldDisallowCall && shouldScreenCallViaAudioProcessing) {
Hall Liu6dfa2492019-10-01 17:20:39 -0700184 throw new IllegalStateException("Invalid response state for allowed call.");
185 }
186
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800187 mShouldDisallowCall = shouldDisallowCall;
188 mShouldRejectCall = shouldRejectCall;
189 mShouldSkipCallLog = shouldSkipCallLog;
190 mShouldSkipNotification = shouldSkipNotification;
Usman Abdullah47b392d2019-03-06 15:54:56 -0800191 mShouldSilenceCall = shouldSilenceCall;
Hall Liu69554cf2019-11-11 17:44:09 -0800192 mShouldScreenCallViaAudioProcessing = shouldScreenCallViaAudioProcessing;
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800193 }
194
195 /*
196 * @return Whether the incoming call should be blocked.
197 */
198 public boolean getDisallowCall() {
199 return mShouldDisallowCall;
200 }
201
202 /*
203 * @return Whether the incoming call should be disconnected as if the user had manually
204 * rejected it.
205 */
206 public boolean getRejectCall() {
207 return mShouldRejectCall;
208 }
209
210 /*
Usman Abdullah47b392d2019-03-06 15:54:56 -0800211 * @return Whether the ringtone should be silenced for the incoming call.
212 */
213 public boolean getSilenceCall() {
214 return mShouldSilenceCall;
215 }
216
217 /*
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800218 * @return Whether the incoming call should not be displayed in the call log.
219 */
220 public boolean getSkipCallLog() {
221 return mShouldSkipCallLog;
222 }
223
224 /*
225 * @return Whether a missed call notification should not be shown for the incoming call.
226 */
227 public boolean getSkipNotification() {
228 return mShouldSkipNotification;
229 }
230
Hall Liu6dfa2492019-10-01 17:20:39 -0700231 /**
232 * @return Whether we should enter the {@link Call#STATE_AUDIO_PROCESSING} state to allow
233 * for further screening of the call.
234 * @hide
235 */
Hall Liu69554cf2019-11-11 17:44:09 -0800236 public boolean getShouldScreenCallViaAudioProcessing() {
237 return mShouldScreenCallViaAudioProcessing;
Hall Liu6dfa2492019-10-01 17:20:39 -0700238 }
239
Sailesh Nepalf4460712016-01-27 16:45:51 -0800240 public static class Builder {
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800241 private boolean mShouldDisallowCall;
242 private boolean mShouldRejectCall;
Usman Abdullah47b392d2019-03-06 15:54:56 -0800243 private boolean mShouldSilenceCall;
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800244 private boolean mShouldSkipCallLog;
245 private boolean mShouldSkipNotification;
Hall Liu69554cf2019-11-11 17:44:09 -0800246 private boolean mShouldScreenCallViaAudioProcessing;
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800247
Tyler Gunne0caec72018-11-30 14:21:18 -0800248 /**
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800249 * Sets whether the incoming call should be blocked.
250 */
251 public Builder setDisallowCall(boolean shouldDisallowCall) {
252 mShouldDisallowCall = shouldDisallowCall;
253 return this;
254 }
255
Tyler Gunne0caec72018-11-30 14:21:18 -0800256 /**
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800257 * Sets whether the incoming call should be disconnected as if the user had manually
258 * rejected it. This property should only be set to true if the call is disallowed.
259 */
260 public Builder setRejectCall(boolean shouldRejectCall) {
261 mShouldRejectCall = shouldRejectCall;
262 return this;
263 }
264
Tyler Gunne0caec72018-11-30 14:21:18 -0800265 /**
Usman Abdullah47b392d2019-03-06 15:54:56 -0800266 * Sets whether ringing should be silenced for the incoming call. When set
267 * to {@code true}, the Telecom framework will not play a ringtone for the call.
268 * The call will, however, still be sent to the default dialer app if it is not blocked.
269 * A {@link CallScreeningService} can use this to ensure a potential nuisance call is
270 * still surfaced to the user, but in a less intrusive manner.
271 *
272 * Setting this to true only makes sense when the call has not been disallowed
273 * using {@link #setDisallowCall(boolean)}.
274 */
275 public @NonNull Builder setSilenceCall(boolean shouldSilenceCall) {
276 mShouldSilenceCall = shouldSilenceCall;
277 return this;
278 }
279
280 /**
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800281 * Sets whether the incoming call should not be displayed in the call log. This property
282 * should only be set to true if the call is disallowed.
Tyler Gunne0caec72018-11-30 14:21:18 -0800283 * <p>
284 * Note: Calls will still be logged with type
285 * {@link android.provider.CallLog.Calls#BLOCKED_TYPE}, regardless of how this property
286 * is set.
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800287 */
288 public Builder setSkipCallLog(boolean shouldSkipCallLog) {
289 mShouldSkipCallLog = shouldSkipCallLog;
290 return this;
291 }
292
Tyler Gunne0caec72018-11-30 14:21:18 -0800293 /**
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800294 * Sets whether a missed call notification should not be shown for the incoming call.
295 * This property should only be set to true if the call is disallowed.
296 */
297 public Builder setSkipNotification(boolean shouldSkipNotification) {
298 mShouldSkipNotification = shouldSkipNotification;
299 return this;
300 }
301
Hall Liu6dfa2492019-10-01 17:20:39 -0700302 /**
303 * Sets whether to request background audio processing so that the in-call service can
304 * screen the call further. If set to {@code true}, {@link #setDisallowCall} should be
305 * called with {@code false}, and all other parameters in this builder will be ignored.
Tyler Gunn460b7d42020-05-15 10:19:32 -0700306 * <p>
Hall Liu6dfa2492019-10-01 17:20:39 -0700307 * This request will only be honored if the {@link CallScreeningService} shares the same
308 * uid as the default dialer app. Otherwise, the call will go through as usual.
Tyler Gunn460b7d42020-05-15 10:19:32 -0700309 * <p>
310 * Apps built with SDK version {@link android.os.Build.VERSION_CODES#R} or later which
311 * are using the microphone as part of audio processing should specify the
312 * foreground service type using the attribute
313 * {@link android.R.attr#foregroundServiceType} in the {@link CallScreeningService}
314 * service element of the app's manifest file.
315 * The {@link ServiceInfo#FOREGROUND_SERVICE_TYPE_MICROPHONE} attribute should be
316 * specified.
317 * @see
318 * <a href="https://developer.android.com/preview/privacy/foreground-service-types">
319 * the Android Developer Site</a> for more information.
Hall Liu6dfa2492019-10-01 17:20:39 -0700320 *
Hall Liu69554cf2019-11-11 17:44:09 -0800321 * @param shouldScreenCallViaAudioProcessing Whether to request further call screening.
Hall Liu6dfa2492019-10-01 17:20:39 -0700322 * @hide
323 */
324 @SystemApi
Hall Liuff4a1252020-01-01 16:27:14 -0800325 @RequiresPermission(Manifest.permission.CAPTURE_AUDIO_OUTPUT)
Hall Liu69554cf2019-11-11 17:44:09 -0800326 public @NonNull Builder setShouldScreenCallViaAudioProcessing(
327 boolean shouldScreenCallViaAudioProcessing) {
328 mShouldScreenCallViaAudioProcessing = shouldScreenCallViaAudioProcessing;
Hall Liu6dfa2492019-10-01 17:20:39 -0700329 return this;
330 }
331
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800332 public CallResponse build() {
333 return new CallResponse(
334 mShouldDisallowCall,
335 mShouldRejectCall,
Usman Abdullah47b392d2019-03-06 15:54:56 -0800336 mShouldSilenceCall,
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800337 mShouldSkipCallLog,
Hall Liu6dfa2492019-10-01 17:20:39 -0700338 mShouldSkipNotification,
Hall Liu69554cf2019-11-11 17:44:09 -0800339 mShouldScreenCallViaAudioProcessing);
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800340 }
341 }
342 }
343
344 public CallScreeningService() {
345 }
346
347 @Override
348 public IBinder onBind(Intent intent) {
349 Log.v(this, "onBind");
350 return new CallScreeningBinder();
351 }
352
353 @Override
354 public boolean onUnbind(Intent intent) {
355 Log.v(this, "onUnbind");
356 return false;
357 }
358
359 /**
Tyler Gunn467acc42020-10-07 15:42:06 -0700360 * Called when a new incoming or outgoing call is added.
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800361 * <p>
362 * A {@link CallScreeningService} must indicate whether an incoming call is allowed or not by
363 * calling
364 * {@link CallScreeningService#respondToCall(Call.Details, CallScreeningService.CallResponse)}.
365 * Your app can tell if a call is an incoming call by checking to see if
366 * {@link Call.Details#getCallDirection()} is {@link Call.Details#DIRECTION_INCOMING}.
367 * <p>
Tyler Gunn467acc42020-10-07 15:42:06 -0700368 * <em>Note:</em> A {@link CallScreeningService} must respond to a call within 5 seconds. After
369 * this time, the framework will unbind from the {@link CallScreeningService} and ignore its
370 * response.
371 * <p>
372 * <em>Note:</em> The {@link Call.Details} instance provided to a call screening service will
373 * only have the following properties set. The rest of the {@link Call.Details} properties will
374 * be set to their default value or {@code null}.
Tyler Gunne0caec72018-11-30 14:21:18 -0800375 * <ul>
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800376 * <li>{@link Call.Details#getCallDirection()}</li>
Tyler Gunn467acc42020-10-07 15:42:06 -0700377 * <li>{@link Call.Details#getCallerNumberVerificationStatus()}</li>
Tyler Gunne0caec72018-11-30 14:21:18 -0800378 * <li>{@link Call.Details#getConnectTimeMillis()}</li>
379 * <li>{@link Call.Details#getCreationTimeMillis()}</li>
380 * <li>{@link Call.Details#getHandle()}</li>
Tyler Gunne0caec72018-11-30 14:21:18 -0800381 * </ul>
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800382 * <p>
383 * Only calls where the {@link Call.Details#getHandle() handle} {@link Uri#getScheme() scheme}
384 * is {@link PhoneAccount#SCHEME_TEL} are passed for call
385 * screening. Further, only calls which are not in the user's contacts are passed for
Tyler Gunn467acc42020-10-07 15:42:06 -0700386 * screening, unless the {@link CallScreeningService} has been granted
387 * {@link Manifest.permission#READ_CONTACTS} permission by the user. For outgoing calls, no
388 * post-dial digits are passed.
389 * <p>
390 * Calls with a {@link Call.Details#getHandlePresentation()} of
391 * {@link TelecomManager#PRESENTATION_RESTRICTED}, {@link TelecomManager#PRESENTATION_UNKNOWN}
392 * or {@link TelecomManager#PRESENTATION_PAYPHONE} presentation are not provided to the
393 * {@link CallScreeningService}.
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800394 *
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800395 * @param callDetails Information about a new call, see {@link Call.Details}.
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800396 */
Tyler Gunn7e45b722018-12-04 12:56:45 -0800397 public abstract void onScreenCall(@NonNull Call.Details callDetails);
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800398
399 /**
Usman Abdullah47b392d2019-03-06 15:54:56 -0800400 * Responds to the given incoming call, either allowing it, silencing it or disallowing it.
Tyler Gunn7e45b722018-12-04 12:56:45 -0800401 * <p>
402 * The {@link CallScreeningService} calls this method to inform the system whether the call
Usman Abdullah47b392d2019-03-06 15:54:56 -0800403 * should be silently blocked or not. In the event that it should not be blocked, it may
404 * also be requested to ring silently.
Tyler Gunn9e76fd19b2018-12-17 09:56:11 -0800405 * <p>
406 * Calls to this method are ignored unless the {@link Call.Details#getCallDirection()} is
407 * {@link Call.Details#DIRECTION_INCOMING}.
Tyler Gunn467acc42020-10-07 15:42:06 -0700408 * <p>
409 * For incoming calls, a {@link CallScreeningService} MUST call this method within 5 seconds of
410 * {@link #onScreenCall(Call.Details)} being invoked by the platform.
411 * <p>
412 * Calls which are blocked/rejected will be logged to the system call log with a call type of
413 * {@link android.provider.CallLog.Calls#BLOCKED_TYPE} and
414 * {@link android.provider.CallLog.Calls#BLOCK_REASON_CALL_SCREENING_SERVICE} block reason.
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800415 *
416 * @param callDetails The call to allow.
Tyler Gunn7e45b722018-12-04 12:56:45 -0800417 * <p>
418 * Must be the same {@link Call.Details call} which was provided to the
419 * {@link CallScreeningService} via {@link #onScreenCall(Call.Details)}.
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800420 * @param response The {@link CallScreeningService.CallResponse} which contains information
421 * about how to respond to a call.
422 */
Tyler Gunn7e45b722018-12-04 12:56:45 -0800423 public final void respondToCall(@NonNull Call.Details callDetails,
424 @NonNull CallResponse response) {
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800425 try {
426 if (response.getDisallowCall()) {
427 mCallScreeningAdapter.disallowCall(
428 callDetails.getTelecomCallId(),
429 response.getRejectCall(),
430 !response.getSkipCallLog(),
tonyzhu9e1d4f82018-10-22 15:11:31 +0800431 !response.getSkipNotification(),
432 new ComponentName(getPackageName(), getClass().getName()));
Usman Abdullah47b392d2019-03-06 15:54:56 -0800433 } else if (response.getSilenceCall()) {
434 mCallScreeningAdapter.silenceCall(callDetails.getTelecomCallId());
Hall Liu69554cf2019-11-11 17:44:09 -0800435 } else if (response.getShouldScreenCallViaAudioProcessing()) {
Hall Liu31de23d2019-10-11 15:38:29 -0700436 mCallScreeningAdapter.screenCallFurther(callDetails.getTelecomCallId());
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800437 } else {
438 mCallScreeningAdapter.allowCall(callDetails.getTelecomCallId());
439 }
440 } catch (RemoteException e) {
441 }
442 }
Sailesh Nepal1bef3392016-01-24 18:21:53 -0800443}