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

# Builder

*** ** * ** ***

```
open class Builder
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.telecom.CallScreeningService.CallResponse.Builder](https://developer.android.com/reference/kotlin/android/telecom/CallScreeningService.CallResponse.Builder#) |

## Summary

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

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

## Public constructors

### Builder

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

```
Builder()
```

## Public methods

### build

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

```
open fun build(): CallScreeningService.CallResponse!
```

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

| Exceptions ||
|---|---|
| `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.html#ApiLevels)

```
open fun setCallComposerAttachmentsToShow(callComposerAttachmentsToShow: Int): CallScreeningService.CallResponse.Builder
```

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/kotlin/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/kotlin/android/telecom/TelecomManager#getSystemDialerPackage()`).

| Parameters ||
|---|---|
| `callComposerAttachmentsToShow` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): A bitmask of call composer attachments to show. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/telecom/CallScreeningService.CallResponse#CALL_COMPOSER_ATTACHMENT_PICTURE:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/telecom/CallScreeningService.CallResponse#CALL_COMPOSER_ATTACHMENT_LOCATION:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/telecom/CallScreeningService.CallResponse#CALL_COMPOSER_ATTACHMENT_SUBJECT:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/telecom/CallScreeningService.CallResponse#CALL_COMPOSER_ATTACHMENT_PRIORITY:kotlin.Int` |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/telecom/CallScreeningService.CallResponse.Builder#` | This value cannot be `null`. |

### setDisallowCall

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

```
open fun setDisallowCall(shouldDisallowCall: Boolean): CallScreeningService.CallResponse.Builder!
```

Sets whether the incoming call should be blocked.

### setRejectCall

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

```
open fun setRejectCall(shouldRejectCall: Boolean): CallScreeningService.CallResponse.Builder!
```

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.

### setRejectedAsMissed

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

```
open fun setRejectedAsMissed(shouldRejectedAsMissed: Boolean): CallScreeningService.CallResponse.Builder
```

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.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/telecom/CallScreeningService.CallResponse.Builder#` | This value cannot be `null`. |

### setSilenceCall

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

```
open fun setSilenceCall(shouldSilenceCall: Boolean): CallScreeningService.CallResponse.Builder
```

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/kotlin/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/kotlin/android/telecom/CallScreeningService.CallResponse.Builder#setDisallowCall(kotlin.Boolean)`.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/telecom/CallScreeningService.CallResponse.Builder#` | This value cannot be `null`. |

### setSkipCallLog

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

```
open fun setSkipCallLog(shouldSkipCallLog: Boolean): CallScreeningService.CallResponse.Builder!
```

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/kotlin/android/provider/CallLog.Calls.html#BLOCKED_TYPE:kotlin.Int`, 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.

### setSkipNotification

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

```
open fun setSkipNotification(shouldSkipNotification: Boolean): CallScreeningService.CallResponse.Builder!
```

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.