For #17165 - Use application context to get notification localized strings

upstream-sync
ekager 3 years ago
parent 7a01fcbfa9
commit d3e1045ab9

@ -58,7 +58,7 @@ class PoweredByNotification(
val appName = getString(R.string.app_name)
return NotificationCompat.Builder(this, channelId)
.setSmallIcon(R.drawable.ic_status_logo)
.setContentTitle(getString(R.string.browser_menu_powered_by2, appName))
.setContentTitle(applicationContext.getString(R.string.browser_menu_powered_by2, appName))
.setBadgeIconType(BADGE_ICON_NONE)
.setColor(ContextCompat.getColor(this, R.color.primary_text_light_theme))
.setPriority(NotificationCompat.PRIORITY_MIN)

@ -33,8 +33,8 @@ class PrivateNotificationService : AbstractPrivateNotificationService() {
override fun NotificationCompat.Builder.buildNotification() {
setSmallIcon(R.drawable.ic_private_browsing)
setContentTitle(getString(R.string.app_name_private_4, getString(R.string.app_name)))
setContentText(getString(R.string.notification_pbm_delete_text_2))
setContentTitle(applicationContext.getString(R.string.app_name_private_4, getString(R.string.app_name)))
setContentText(applicationContext.getString(R.string.notification_pbm_delete_text_2))
color = ContextCompat.getColor(this@PrivateNotificationService, R.color.pbm_notification_color)
}

Loading…
Cancel
Save