Fix notifications not being reset when there is no device.

This commit is contained in:
darken
2022-01-12 16:56:13 +01:00
parent 8bc1a193c8
commit 8d5d90f457
@@ -59,6 +59,8 @@ class MonitorNotifications @Inject constructor(
fun getBuilder(device: PodDevice?): NotificationCompat.Builder {
if (device == null) {
return builder.apply {
setCustomContentView(null)
setStyle(NotificationCompat.BigTextStyle())
setContentTitle(context.getString(R.string.pods_none_label_short))
setSubText(context.getString(R.string.app_name))
setSmallIcon(R.drawable.ic_device_generic_earbuds)
@@ -66,10 +68,10 @@ class MonitorNotifications @Inject constructor(
}
return builder.apply {
setSmallIcon(device.iconRes)
setSubText(null)
setStyle(NotificationCompat.DecoratedCustomViewStyle())
setCustomContentView(notificationViewFactory.createContentView(device))
setSmallIcon(device.iconRes)
setSubText(null)
log(TAG, VERBOSE) { "updatingNotification(): $device" }
}
}