mirror of
https://github.com/home-assistant/android
synced 2024-10-15 12:32:54 +00:00
Default to app icon if icon is not available for notification (#2936)
This commit is contained in:
parent
abf0220430
commit
48f2ca3125
|
@ -1103,8 +1103,11 @@ class MessagingManager @Inject constructor(
|
|||
if (data[NOTIFICATION_ICON]?.startsWith("mdi:") == true && !data[NOTIFICATION_ICON]?.substringAfter("mdi:").isNullOrBlank() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
val iconName = data[NOTIFICATION_ICON]!!.split(":")[1]
|
||||
val iconDrawable =
|
||||
IconicsDrawable(context, "cmd-$iconName").toAndroidIconCompat()
|
||||
builder.setSmallIcon(iconDrawable)
|
||||
IconicsDrawable(context, "cmd-$iconName")
|
||||
if (iconDrawable.icon != null)
|
||||
builder.setSmallIcon(iconDrawable.toAndroidIconCompat())
|
||||
else
|
||||
builder.setSmallIcon(commonR.drawable.ic_stat_ic_notification)
|
||||
} else
|
||||
builder.setSmallIcon(commonR.drawable.ic_stat_ic_notification)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue