Skip to content

Commit

Permalink
Don't set app name in notifications
Browse files Browse the repository at this point in the history
Closes openhab#3130

Signed-off-by: mueller-ma <[email protected]>
  • Loading branch information
mueller-ma committed Jan 9, 2024
1 parent 0a6451c commit f5b7dc3
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,15 @@ class NotificationHelper constructor(private val context: Context) {
R.plurals.summary_notification_text, 1, 1
)
val publicVersion = makeNotificationBuilder(channelId, message.createdTimestamp)
.setContentText(publicText)
.setContentTitle(publicText)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setContentIntent(contentIntent)
.build()

return makeNotificationBuilder(channelId, message.createdTimestamp)
.setLargeIcon(iconBitmap)
.setStyle(NotificationCompat.BigTextStyle().bigText(message.message))
.setSound(context.getPrefs().getNotificationTone())
.setContentText(message.message)
.setContentTitle(message.message)
.setSubText(message.severity)
.setContentIntent(contentIntent)
.setDeleteIntent(deleteIntent)
Expand Down Expand Up @@ -204,15 +203,15 @@ class NotificationHelper constructor(private val context: Context) {
timestamp
)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setContentText(text)
.setContentTitle(text)
.setContentIntent(clickIntent)
.build()

return makeNotificationBuilder(NotificationUpdateObserver.CHANNEL_ID_MESSAGE_DEFAULT, timestamp)
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN)
.setGroupSummary(true)
.setGroup("gcm")
.setContentText(text)
.setContentTitle(text)
.setPublicVersion(publicVersion)
.setContentIntent(clickIntent)
.setDeleteIntent(deleteIntent)
Expand Down Expand Up @@ -240,18 +239,15 @@ class NotificationHelper constructor(private val context: Context) {
private fun makeNotificationBuilder(
channelId: String,
timestamp: Long
): NotificationCompat.Builder {
return NotificationCompat.Builder(context, channelId)
) = NotificationCompat.Builder(context, channelId)
.setSmallIcon(R.drawable.ic_openhab_appicon_white_24dp)
.setContentTitle(context.getString(R.string.app_name))
.setWhen(timestamp)
.setShowWhen(timestamp != 0L)
.setColor(ContextCompat.getColor(context, R.color.openhab_orange))
.setAutoCancel(true)
.setLights(ContextCompat.getColor(context, R.color.openhab_orange), 3000, 3000)
.setVibrate(context.getPrefs().getNotificationVibrationPattern(context))
.setGroup("gcm")
}

companion object {
private val TAG = NotificationHelper::class.java.simpleName
Expand Down

0 comments on commit f5b7dc3

Please sign in to comment.