# CarNotificationManager

# CarNotificationManager

Artifact:[androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app)  
[View Source](https://cs.android.com/search?q=file:androidx/car/app/notification/CarNotificationManager.java+class:androidx.car.app.notification.CarNotificationManager)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/car/app/notification/CarNotificationManager "View this page in Java")

<br />

```
class CarNotificationManager
```

<br />

*** ** * ** ***

A manager for car apps to send notifications. This class wraps a[NotificationManagerCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat)to manage the actual sending of the[Notification](https://developer.android.com/reference/android/app/Notification.html).

## Summary

|                                                                                                                                                            ### Public functions                                                                                                                                                             |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                                                                                                                                                                         | [areNotificationsEnabled](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#areNotificationsEnabled())`()` Returns whether notifications from the calling package are not blocked.                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                               | [cancel](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#cancel(int))`(id: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Cancels a previously shown notification.                                                                                                                                                                                                                                                                                                                                                                                                             |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                               | [cancel](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#cancel(java.lang.String,int))`(tag: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?, id: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Cancels a previously shown notification.                                                                                                                                                                                                                                                                                                 |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                               | [cancelAll](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#cancelAll())`()` Cancels all previously shown notifications.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                               | [createNotificationChannel](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#createNotificationChannel(androidx.core.app.NotificationChannelCompat))`(channel: `[NotificationChannelCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationChannelCompat)`)` Creates a notification channel that notifications can be posted to.                                                                                                                                                                                                                                                   |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                               | [createNotificationChannelGroup](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#createNotificationChannelGroup(androidx.core.app.NotificationChannelGroupCompat))`(group: `[NotificationChannelGroupCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationChannelGroupCompat)`)` Creates a group container for[NotificationChannel](https://developer.android.com/reference/android/app/NotificationChannel.html)objects.                                                                                                                                                       |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                               | [createNotificationChannelGroups](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#createNotificationChannelGroups(java.util.List<androidx.core.app.NotificationChannelGroupCompat>))`(` ` groups: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[NotificationChannelGroupCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationChannelGroupCompat)`!>` `)` Creates multiple notification channel groups.                  |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                               | [createNotificationChannels](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#createNotificationChannels(java.util.List<androidx.core.app.NotificationChannelCompat>))`(` ` channels: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[NotificationChannelCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationChannelCompat)`!>` `)` Creates multiple notification channels that different notifications can be posted to. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                               | [deleteNotificationChannel](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#deleteNotificationChannel(java.lang.String))`(channelId: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`)` Deletes the given notification channel.                                                                                                                                                                                                                                                                                                                                              |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                               | [deleteNotificationChannelGroup](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#deleteNotificationChannelGroup(java.lang.String))`(groupId: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`)` Deletes the given notification channel group, and all notification channels that belong to it.                                                                                                                                                                                                                                                                               |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                               | [deleteUnlistedNotificationChannels](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#deleteUnlistedNotificationChannels(java.util.Collection<java.lang.String>))`(` ` channelIds: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)`)`[Collection](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>` `)` Deletes notification channels for which ids are NOT given.                                                   |
| `java-static `[CarNotificationManager](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager)                                                                                                                                                                                                 | [from](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#from(android.content.Context))`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`)` Returns a[CarNotificationManager](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager)instance for a provided context.                                                                                                                                                                                                                                                      |
| `java-static (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)`)`[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!>`                                        | [getEnabledListenerPackages](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#getEnabledListenerPackages(android.content.Context))`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`)` Get the set of packages that have an enabled notification listener component within them.                                                                                                                                                                                                                                                                                       |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                                                                                                                                                                                 | [getImportance](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#getImportance())`()` Returns the user specified importance for notifications from the calling package.                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [NotificationChannelCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationChannelCompat)`?`                                                                                                                                                                                                                  | [getNotificationChannel](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#getNotificationChannel(java.lang.String))`(channelId: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`)` Returns the notification channel settings for a given channel id.                                                                                                                                                                                                                                                                                                                          |
| [NotificationChannelCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationChannelCompat)`?`                                                                                                                                                                                                                  | [getNotificationChannel](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#getNotificationChannel(java.lang.String,java.lang.String))`(channelId: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`, conversationId: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`)` Returns the notification channel settings for a given channel and[conversation id](https://developer.android.com/reference/android/content/pm/ShortcutInfo.html#getId()).                                                                                            |
| [NotificationChannelGroupCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationChannelGroupCompat)`?`                                                                                                                                                                                                        | [getNotificationChannelGroup](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#getNotificationChannelGroup(java.lang.String))`(channelGroupId: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`)` Returns the notification channel group settings for a given channel group id.                                                                                                                                                                                                                                                                                               |
| `(`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[NotificationChannelGroupCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationChannelGroupCompat)`!>` | [getNotificationChannelGroups](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#getNotificationChannelGroups())`()` Returns all notification channel groups belonging to the calling app or an empty list on older SDKs which don't support Notification Channels.                                                                                                                                                                                                                                                                                                                                               |
| `(`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[NotificationChannelCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationChannelCompat)`!>`           | [getNotificationChannels](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#getNotificationChannels())`()` Returns all notification channels belonging to the calling app or an empty list on older SDKs which don't support Notification Channels.                                                                                                                                                                                                                                                                                                                                                               |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                               | [notify](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#notify(int,androidx.core.app.NotificationCompat.Builder))`(id: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, notification: `[NotificationCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder)`)` Posts a notification.                                                                                                                                                                                                                                        |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                                                                                                                                                                               | [notify](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#notify(java.lang.String,int,androidx.core.app.NotificationCompat.Builder))`(tag: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?, id: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, notification: `[NotificationCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder)`)` Post a notification to be shown in the status bar, stream, etc.                                                                                  |

## Public functions

### areNotificationsEnabled

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun areNotificationsEnabled(): Boolean
```

Returns whether notifications from the calling package are not blocked.  

|                                                                    See also                                                                     |
|-------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [areNotificationsEnabled](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#areNotificationsEnabled()) |   |

### cancel

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun cancel(id: Int): Unit
```

Cancels a previously shown notification.  

|                                                     See also                                                     |
|------------------------------------------------------------------------------------------------------------------|---|
| [cancel](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#cancel(int)) |   |

### cancel

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun cancel(tag: String?, id: Int): Unit
```

Cancels a previously shown notification.  

|                                                             See also                                                              |
|-----------------------------------------------------------------------------------------------------------------------------------|---|
| [cancel](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#cancel(java.lang.String,int)) |   |

### cancelAll

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun cancelAll(): Unit
```

Cancels all previously shown notifications.  

|                                                      See also                                                       |
|---------------------------------------------------------------------------------------------------------------------|---|
| [cancelAll](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#cancelAll()) |   |

### createNotificationChannel

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun createNotificationChannel(channel: NotificationChannelCompat): Unit
```

Creates a notification channel that notifications can be posted to.  

|                                                    Throws                                                     |
|---------------------------------------------------------------------------------------------------------------|---------------------|
| [java.lang.NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException.html) | if`channel`is`null` |

|                                                                                            See also                                                                                            |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [createNotificationChannel](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#createNotificationChannel(androidx.core.app.NotificationChannelCompat)) |   |

### createNotificationChannelGroup

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun createNotificationChannelGroup(group: NotificationChannelGroupCompat): Unit
```

Creates a group container for[NotificationChannel](https://developer.android.com/reference/android/app/NotificationChannel.html)objects.  

|                                                    Throws                                                     |
|---------------------------------------------------------------------------------------------------------------|-------------------|
| [java.lang.NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException.html) | if`group`is`null` |

|                                                                                                   See also                                                                                                    |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [createNotificationChannelGroup](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#createNotificationChannelGroup(androidx.core.app.NotificationChannelGroupCompat)) |   |

### createNotificationChannelGroups

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun createNotificationChannelGroups(
    groups: (Mutable)List<NotificationChannelGroupCompat!>
): Unit
```

Creates multiple notification channel groups. See[createNotificationChannelGroup](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#createNotificationChannelGroup(androidx.core.app.NotificationChannelGroupCompat)).  

|                                                    Throws                                                     |
|---------------------------------------------------------------------------------------------------------------|--------------------|
| [java.lang.NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException.html) | if`groups`is`null` |

|                                                                                                                  See also                                                                                                                   |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [createNotificationChannelGroupsCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#createNotificationChannelGroupsCompat(java.util.List<androidx.core.app.NotificationChannelGroupCompat>)) |   |

### createNotificationChannels

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun createNotificationChannels(
    channels: (Mutable)List<NotificationChannelCompat!>
): Unit
```

Creates multiple notification channels that different notifications can be posted to. See[createNotificationChannel](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager#createNotificationChannel(androidx.core.app.NotificationChannelCompat)).  

|                                                    Throws                                                     |
|---------------------------------------------------------------------------------------------------------------|----------------------|
| [java.lang.NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException.html) | if`channels`is`null` |

|                                                                                                           See also                                                                                                           |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [createNotificationChannelsCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#createNotificationChannelsCompat(java.util.List<androidx.core.app.NotificationChannelCompat>)) |   |

### deleteNotificationChannel

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun deleteNotificationChannel(channelId: String): Unit
```

Deletes the given notification channel.  

|                                                    Throws                                                     |
|---------------------------------------------------------------------------------------------------------------|-----------------------|
| [java.lang.NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException.html) | if`channelId`is`null` |

|                                                                              See also                                                                               |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [deleteNotificationChannel](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#deleteNotificationChannel(java.lang.String)) |   |

### deleteNotificationChannelGroup

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun deleteNotificationChannelGroup(groupId: String): Unit
```

Deletes the given notification channel group, and all notification channels that belong to it.  

|                                                    Throws                                                     |
|---------------------------------------------------------------------------------------------------------------|---------------------|
| [java.lang.NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException.html) | if`groupId`is`null` |

|                                                                                   See also                                                                                    |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [deleteNotificationChannelGroup](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#deleteNotificationChannelGroup(java.lang.String)) |   |

### deleteUnlistedNotificationChannels

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun deleteUnlistedNotificationChannels(
    channelIds: (Mutable)Collection<String!>
): Unit
```

Deletes notification channels for which ids are NOT given.  

|                                                    Throws                                                     |
|---------------------------------------------------------------------------------------------------------------|------------------------|
| [java.lang.NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException.html) | if`channelIds`is`null` |

|                                                                                                  See also                                                                                                   |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [deleteUnlistedNotificationChannels](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#deleteUnlistedNotificationChannels(java.util.Collection<java.lang.String>)) |   |

### from

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
java-static fun from(context: Context): CarNotificationManager
```

Returns a[CarNotificationManager](https://developer.android.com/reference/kotlin/androidx/car/app/notification/CarNotificationManager)instance for a provided context.  

|                                                    Throws                                                     |
|---------------------------------------------------------------------------------------------------------------|---------------------|
| [java.lang.NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException.html) | if`context`is`null` |

### getEnabledListenerPackages

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
java-static fun getEnabledListenerPackages(context: Context): (Mutable)Set<String!>
```

Get the set of packages that have an enabled notification listener component within them.  

|                                                    Throws                                                     |
|---------------------------------------------------------------------------------------------------------------|---------------------|
| [java.lang.NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException.html) | if`context`is`null` |

|                                                                                   See also                                                                                   |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getEnabledListenerPackages](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#getEnabledListenerPackages(android.content.Context)) |   |

### getImportance

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun getImportance(): Int
```

Returns the user specified importance for notifications from the calling package.  

|                                                          See also                                                           |
|-----------------------------------------------------------------------------------------------------------------------------|---|
| [getImportance](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#getImportance()) |   |

### getNotificationChannel

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun getNotificationChannel(channelId: String): NotificationChannelCompat?
```

Returns the notification channel settings for a given channel id.  

|                                                    Throws                                                     |
|---------------------------------------------------------------------------------------------------------------|-----------------------|
| [java.lang.NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException.html) | if`channelId`is`null` |

|                                                                                 See also                                                                                  |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getNotificationChannelCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#getNotificationChannelCompat(java.lang.String)) |   |

### getNotificationChannel

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun getNotificationChannel(channelId: String, conversationId: String): NotificationChannelCompat?
```

Returns the notification channel settings for a given channel and[conversation id](https://developer.android.com/reference/android/content/pm/ShortcutInfo.html#getId()).  

|                                                    Throws                                                     |
|---------------------------------------------------------------------------------------------------------------|--------------------------------------------------|
| [java.lang.NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException.html) | if either`channelId`of`conversationId`are` null` |

|                                                                                          See also                                                                                          |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getNotificationChannelCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#getNotificationChannelCompat(java.lang.String,java.lang.String)) |   |

### getNotificationChannelGroup

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun getNotificationChannelGroup(channelGroupId: String): NotificationChannelGroupCompat?
```

Returns the notification channel group settings for a given channel group id.  

|                                                    Throws                                                     |
|---------------------------------------------------------------------------------------------------------------|----------------------------|
| [java.lang.NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException.html) | if`channelGroupId`is`null` |

|                                                                                      See also                                                                                       |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getNotificationChannelGroupCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#getNotificationChannelGroupCompat(java.lang.String)) |   |

### getNotificationChannelGroups

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun getNotificationChannelGroups(): (Mutable)List<NotificationChannelGroupCompat!>
```

Returns all notification channel groups belonging to the calling app or an empty list on older SDKs which don't support Notification Channels.  

|                                                                               See also                                                                                |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getNotificationChannelGroupsCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#getNotificationChannelGroupsCompat()) |   |

### getNotificationChannels

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun getNotificationChannels(): (Mutable)List<NotificationChannelCompat!>
```

Returns all notification channels belonging to the calling app or an empty list on older SDKs which don't support Notification Channels.  

|                                                                          See also                                                                           |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getNotificationChannelsCompat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#getNotificationChannelsCompat()) |   |

### notify

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun notify(id: Int, notification: NotificationCompat.Builder): Unit
```

Posts a notification.

Callers are expected to extend the notification with CarAppExtender to ensure the notification will show up on all car environments. This method will extend the notification if it is not already extended for the car using a CarAppExtender.  

|                                                    Throws                                                     |
|---------------------------------------------------------------------------------------------------------------|--------------------------|
| [java.lang.NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException.html) | if`notification`is`null` |

|                                                                 See also                                                                  |
|-------------------------------------------------------------------------------------------------------------------------------------------|---|
| [notify](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#notify(int,android.app.Notification)) |   |

### notify

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun notify(tag: String?, id: Int, notification: NotificationCompat.Builder): Unit
```

Post a notification to be shown in the status bar, stream, etc.

Callers are expected to extend the notification with CarAppExtender to ensure the notification will show up on all car environments. This method will extend the notification if it is not already extended for the car using a CarAppExtender.  

|                                                                Parameters                                                                 |
|-------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| `tag: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?`                                               | the string identifier for a notification. Can be`null`.                        |
| `id: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                         | the ID of the notification. The pair (tag, id) must be unique within your app. |
| `notification: `[NotificationCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Builder) | the notification to post to the system                                         |

|                                                    Throws                                                     |
|---------------------------------------------------------------------------------------------------------------|--------------------------|
| [java.lang.NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException.html) | if notification is`null` |