Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder#inhmethods)

# CallScreeningService.CallResponse.Builder

*** ** * ** ***


`
public
static


class
CallScreeningService.CallResponse.Builder
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.telecom.CallScreeningService.CallResponse.Builder |

<br />

*** ** * ** ***

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder#Builder()() ` |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse` | ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder#build()() ` Builds the `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse` object. |
| ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder` | ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder#setCallComposerAttachmentsToShow(int)(int callComposerAttachmentsToShow) ` Sets the call composer attachments that should be shown to the user. |
| ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder` | ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder#setDisallowCall(boolean)(boolean shouldDisallowCall) ` Sets whether the incoming call should be blocked. |
| ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder` | ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder#setRejectCall(boolean)(boolean shouldRejectCall) ` Sets whether the incoming call should be disconnected as if the user had manually rejected it. |
| ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder` | ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder#setRejectedAsMissed(boolean)(boolean shouldRejectedAsMissed) ` Sets whether the incoming call should be rejected and marked as if it is a missed call. |
| ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder` | ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder#setSilenceCall(boolean)(boolean shouldSilenceCall) ` Sets whether ringing should be silenced for the incoming call. |
| ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder` | ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder#setSkipCallLog(boolean)(boolean shouldSkipCallLog) ` Sets whether the incoming call should not be displayed in the call log. |
| ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder` | ` https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder#setSkipNotification(boolean)(boolean shouldSkipNotification) ` Sets whether a missed call notification should not be shown for the incoming call. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


## Public constructors

### Builder

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder ()
```

<br />

<br />

## Public methods

### build

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CallScreeningService.CallResponse build ()
```

Builds the `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse` object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If `shouldDisallowCall` is `false` and `shouldRejectAsMissed` is `true`, or if `shouldRejectAsMissed` is `true` and `shouldRejectCall` is `false`. |

### setCallComposerAttachmentsToShow

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CallScreeningService.CallResponse.Builder setCallComposerAttachmentsToShow (int callComposerAttachmentsToShow)
```

Sets the call composer attachments that should be shown to the user.

Attachments that are not shown will not be passed to the in-call UI responsible for
displaying the call to the user.

If this method is not called on a `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder`, all attachments will be shown,
except pictures, which will only be shown to users if the call is from a contact.

Setting attachments to show will have no effect if the call screening service does
not belong to the same package as the system dialer (as returned by
`https://developer.android.com/reference/android/telecom/TelecomManager#getSystemDialerPackage()`).

<br />

| Parameters ||
|---|---|
| `callComposerAttachmentsToShow` | `int`: A bitmask of call composer attachments to show. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse#CALL_COMPOSER_ATTACHMENT_PICTURE` - `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse#CALL_COMPOSER_ATTACHMENT_LOCATION` - `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse#CALL_COMPOSER_ATTACHMENT_SUBJECT` - `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse#CALL_COMPOSER_ATTACHMENT_PRIORITY` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder` | This value cannot be `null`. <br /> |

### setDisallowCall

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CallScreeningService.CallResponse.Builder setDisallowCall (boolean shouldDisallowCall)
```

Sets whether the incoming call should be blocked.

<br />

| Parameters ||
|---|---|
| `shouldDisallowCall` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder` | <br /> |

### setRejectCall

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CallScreeningService.CallResponse.Builder setRejectCall (boolean shouldRejectCall)
```

Sets whether the incoming call should be disconnected as if the user had manually
rejected it. This property should only be set to true if the call is disallowed.

<br />

| Parameters ||
|---|---|
| `shouldRejectCall` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder` | <br /> |

### setRejectedAsMissed

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public CallScreeningService.CallResponse.Builder setRejectedAsMissed (boolean shouldRejectedAsMissed)
```

Sets whether the incoming call should be rejected and marked as if it is a
missed call.
This property should only be set to true if the call is disallowed.

<br />

| Parameters ||
|---|---|
| `shouldRejectedAsMissed` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder` | This value cannot be `null`. <br /> |

### setSilenceCall

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CallScreeningService.CallResponse.Builder setSilenceCall (boolean shouldSilenceCall)
```

Sets whether ringing should be silenced for the incoming call. When set
to `true`, the Telecom framework will not play a ringtone for the call.
The call will, however, still be sent to the default dialer app if it is not blocked.
A `https://developer.android.com/reference/android/telecom/CallScreeningService` can use this to ensure a potential nuisance call is
still surfaced to the user, but in a less intrusive manner.

Setting this to true only makes sense when the call has not been disallowed
using `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder#setDisallowCall(boolean)`.

<br />

| Parameters ||
|---|---|
| `shouldSilenceCall` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder` | This value cannot be `null`. <br /> |

### setSkipCallLog

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CallScreeningService.CallResponse.Builder setSkipCallLog (boolean shouldSkipCallLog)
```

Sets whether the incoming call should not be displayed in the call log. This property
should only be set to true if the call is disallowed.


Note: Calls will still be logged with type
`https://developer.android.com/reference/android/provider/CallLog.Calls#BLOCKED_TYPE`, regardless of how this property
is set.


Note: Only the carrier and system call screening apps can use this parameter;
this parameter is ignored otherwise.

<br />

| Parameters ||
|---|---|
| `shouldSkipCallLog` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder` | <br /> |

### setSkipNotification

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public CallScreeningService.CallResponse.Builder setSkipNotification (boolean shouldSkipNotification)
```

Sets whether a missed call notification should not be shown for the incoming call.
This property should only be set to true if the call is disallowed.

<br />

| Parameters ||
|---|---|
| `shouldSkipNotification` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/telecom/CallScreeningService.CallResponse.Builder` | <br /> |