# NotificationCompat.CallStyle

# NotificationCompat.CallStyle

Artifact:[androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core)  
[View Source](https://cs.android.com/search?q=file:androidx/core/app/NotificationCompat.java+class:androidx.core.app.NotificationCompat.CallStyle)  
Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/app/NotificationCompat.CallStyle "View this page in Java")

<br />

```
class NotificationCompat.CallStyle : NotificationCompat.Style
```

<br />

|---|---|-------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                                                    |||
| ↳ | [androidx.core.app.NotificationCompat.Style](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Style)            ||
|   | ↳ | [androidx.core.app.NotificationCompat.CallStyle](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle) |

*** ** * ** ***

Helper class for generating large-format notifications that include a caller and required actions, and indicate an incoming call. If the platform does not provide large-format notifications, this method has no effect. The user will always see the normal notification view. This class is a "rebuilder": It attaches to a Builder object and modifies its behavior, like so:  

```kotlin
Notification notification = new NotificationCompat.Builder(mContext)
    .setSmallIcon(R.drawable.new_post)
    .setStyle(
            new Notification.CallStyle.forIncomingCall(caller, declineIntent, answerIntent))
    .build();
```
Note that for CallStyle Notifications on API versions before 31 to be ranked as they are in API versions 31+, they must be associated with a foreground service. Additionally, CallStyle Notifications on API versions before 31 can achieve the similar ranking by marking the Notification as colorized, using[setColorized](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#setColorized(boolean)).

## Summary

|                                    ### Constants                                    |
|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [CALL_TYPE_INCOMING](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#CALL_TYPE_INCOMING())` = 1` Call type for incoming calls.                  |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [CALL_TYPE_ONGOING](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#CALL_TYPE_ONGOING())` = 2` Call type for ongoing calls.                     |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [CALL_TYPE_SCREENING](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#CALL_TYPE_SCREENING())` = 3` Call type for calls that are being screened. |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [CALL_TYPE_UNKNOWN](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#CALL_TYPE_UNKNOWN())` = 0` Unknown call type.                               |

|                                                                                                                                                                      ### Public constructors                                                                                                                                                                      |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [CallStyle](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#CallStyle())`()`                                                                                                                                                                                                                                        |
| [CallStyle](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#CallStyle(androidx.core.app.NotificationCompat.Builder))`(builder: `[NotificationCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder)`?)` Creates a CallStyle linked to a notification builder. |

|                                                            ### Public functions                                                             |
|---------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[NotificationCompat.CallStyle](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle) | [forIncomingCall](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#forIncomingCall(androidx.core.app.Person,android.app.PendingIntent,android.app.PendingIntent))`(` ` person: `[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)`,` ` declineIntent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`,` ` answerIntent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html) `)` Creates a CallStyle for an incoming call.                                                  |
| `java-static `[NotificationCompat.CallStyle](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle) | [forOngoingCall](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#forOngoingCall(androidx.core.app.Person,android.app.PendingIntent))`(person: `[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)`, hangUpIntent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`)` Creates a CallStyle for an ongoing call.                                                                                                                                                                                                    |
| `java-static `[NotificationCompat.CallStyle](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle) | [forScreeningCall](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#forScreeningCall(androidx.core.app.Person,android.app.PendingIntent,android.app.PendingIntent))`(` ` person: `[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)`,` ` hangUpIntent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`,` ` answerIntent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html) `)` Creates a CallStyle for a call that is being screened.                                    |
| [NotificationCompat.CallStyle](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle)               | [setAnswerButtonColorHint](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#setAnswerButtonColorHint(int))`(color: @`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Sets an optional color to be used as a hint for the Answer action button's color.                                                                                                                                                                                                           |
| [NotificationCompat.CallStyle](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle)               | [setDeclineButtonColorHint](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#setDeclineButtonColorHint(int))`(color: @`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Sets an optional color to be used as a hint for the Decline or Hang Up action button's color.                                                                                                                                                                                             |
| [NotificationCompat.CallStyle](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle)               | [setIsVideo](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#setIsVideo(boolean))`(isVideo: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Sets whether the call is a video call, which may affect the icons or text used on the required action buttons.                                                                                                                                                                                                                                                                                       |
| [NotificationCompat.CallStyle](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle)               | [setVerificationIcon](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#setVerificationIcon(android.graphics.Bitmap))`(verificationIcon: `[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)`?)` Sets an optional icon to be displayed with[text](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#setVerificationText(java.lang.CharSequence))as a verification status of the caller.                                                                                                                            |
| [NotificationCompat.CallStyle](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle)               | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 23)` [setVerificationIcon](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#setVerificationIcon(android.graphics.drawable.Icon))`(verificationIcon: `[Icon](https://developer.android.com/reference/android/graphics/drawable/Icon.html)`?)` Sets an optional icon to be displayed with[text](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#setVerificationText(java.lang.CharSequence))as a verification status of the caller. |
| [NotificationCompat.CallStyle](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle)               | [setVerificationText](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#setVerificationText(java.lang.CharSequence))`(verificationText: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`?)` Sets optional text to be displayed with an[icon](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#setVerificationIcon(android.graphics.drawable.Icon))as a verification status of the caller.                                                                                                     |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.core.app.NotificationCompat.Style](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Style) |------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Notification](https://developer.android.com/reference/android/app/Notification.html)`?` | [build](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Style#build())`()` If this Style object has been set on a notification builder, this method will build that notification and return it.                                                                                                                                      | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)            | [setBuilder](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Style#setBuilder(androidx.core.app.NotificationCompat.Builder))`(builder: `[NotificationCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder)`?)` Link this rich notification style with a notification builder. | |

## Constants

### CALL_TYPE_INCOMING

Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)  

```
const val CALL_TYPE_INCOMING = 1: Int
```

Call type for incoming calls. See[EXTRA_CALL_TYPE](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat#EXTRA_CALL_TYPE()).  

### CALL_TYPE_ONGOING

Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)  

```
const val CALL_TYPE_ONGOING = 2: Int
```

Call type for ongoing calls. See[EXTRA_CALL_TYPE](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat#EXTRA_CALL_TYPE()).  

### CALL_TYPE_SCREENING

Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)  

```
const val CALL_TYPE_SCREENING = 3: Int
```

Call type for calls that are being screened. See[EXTRA_CALL_TYPE](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat#EXTRA_CALL_TYPE()).  

### CALL_TYPE_UNKNOWN

Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)  

```
const val CALL_TYPE_UNKNOWN = 0: Int
```

Unknown call type. See[EXTRA_CALL_TYPE](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat#EXTRA_CALL_TYPE()).  

## Public constructors

### CallStyle

Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)  

```
CallStyle()
```  

### CallStyle

Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)  

```
CallStyle(builder: NotificationCompat.Builder?)
```

Creates a CallStyle linked to a notification builder.  

|                                                               Parameters                                                                |
|-----------------------------------------------------------------------------------------------------------------------------------------|----------------------------------|
| `builder: `[NotificationCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder)`?` | the notification builder to link |

## Public functions

### forIncomingCall

Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)  

```
java-static fun forIncomingCall(
    person: Person,
    declineIntent: PendingIntent,
    answerIntent: PendingIntent
): NotificationCompat.CallStyle
```

Creates a CallStyle for an incoming call. This notification will have a decline and an answer action, will allow a single custom[action](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#addAction(androidx.core.app.NotificationCompat.Action)), and will have a default[content text](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#setContentText(java.lang.CharSequence))for an incoming call.  

|                                                Parameters                                                |
|----------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| `person: `[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)              | the person displayed as the caller the person also needs to have a non-empty name associated with it |
| `declineIntent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html) | the intent to be sent when the user taps the decline action                                          |
| `answerIntent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)  | the intent to be sent when the user taps the answer action                                           |

### forOngoingCall

Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)  

```
java-static fun forOngoingCall(person: Person, hangUpIntent: PendingIntent): NotificationCompat.CallStyle
```

Creates a CallStyle for an ongoing call. This notification will have a hang up action, will allow up to two custom[actions](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#addAction(androidx.core.app.NotificationCompat.Action)), and will have a default[content text](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#setContentText(java.lang.CharSequence))for an ongoing call.  

|                                               Parameters                                                |
|---------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|
| `person: `[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)             | the person displayed as being on the other end of the call the person also needs to have a non-empty name associated with it |
| `hangUpIntent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html) | the intent to be sent when the user taps the hang up action                                                                  |

### forScreeningCall

Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)  

```
java-static fun forScreeningCall(
    person: Person,
    hangUpIntent: PendingIntent,
    answerIntent: PendingIntent
): NotificationCompat.CallStyle
```

Creates a CallStyle for a call that is being screened. This notification will have a hang up and an answer action, will allow a single custom[action](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#addAction(androidx.core.app.NotificationCompat.Action)), and will have a default[content text](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder#setContentText(java.lang.CharSequence))for a call that is being screened.  

|                                               Parameters                                                |
|---------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| `person: `[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)             | the person displayed as the caller the person also needs to have a non-empty name associated with it |
| `hangUpIntent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html) | the intent to be sent when the user taps the hang up action                                          |
| `answerIntent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html) | the intent to be sent when the user taps the answer action                                           |

### setAnswerButtonColorHint

Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)  

```
fun setAnswerButtonColorHint(color: @ColorInt Int): NotificationCompat.CallStyle
```

Sets an optional color to be used as a hint for the Answer action button's color. The system may change this color to ensure sufficient contrast with the background. The system may choose to disregard this hint if the notification is not colorized.  

### setDeclineButtonColorHint

Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)  

```
fun setDeclineButtonColorHint(color: @ColorInt Int): NotificationCompat.CallStyle
```

Sets an optional color to be used as a hint for the Decline or Hang Up action button's color. The system may change this color to ensure sufficient contrast with the background. The system may choose to disregard this hint if the notification is not colorized.  

### setIsVideo

Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)  

```
fun setIsVideo(isVideo: Boolean): NotificationCompat.CallStyle
```

Sets whether the call is a video call, which may affect the icons or text used on the required action buttons.  

### setVerificationIcon

Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)  

```
fun setVerificationIcon(verificationIcon: Bitmap?): NotificationCompat.CallStyle
```

Sets an optional icon to be displayed with[text](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#setVerificationText(java.lang.CharSequence))as a verification status of the caller.  

### setVerificationIcon

Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)  

```
@RequiresApi(value = 23)
fun setVerificationIcon(verificationIcon: Icon?): NotificationCompat.CallStyle
```

Sets an optional icon to be displayed with[text](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#setVerificationText(java.lang.CharSequence))as a verification status of the caller.  

### setVerificationText

Added in[1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)  

```
fun setVerificationText(verificationText: CharSequence?): NotificationCompat.CallStyle
```

Sets optional text to be displayed with an[icon](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.CallStyle#setVerificationIcon(android.graphics.drawable.Icon))as a verification status of the caller.