Skip to content

Commit

Permalink
Ensure Legacy notifications are local only, have correct priority
Browse files Browse the repository at this point in the history
On pre-API 26 devices, we need to set the priority/sound/vibrate on the notification itself. As the notification is related only to the phone and not connected devices, it should be local only and not bridged over.
  • Loading branch information
ianhanniballake committed Jul 11, 2019
1 parent d23e0a9 commit 47c4342
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -109,6 +109,9 @@ class LegacySourcePackageListener(
.setStyle(NotificationCompat.BigTextStyle().bigText(
applicationContext.getString(R.string.legacy_notification_text)))
.setLargeIcon(info.icon)
.setLocalOnly(true)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
.setDefaults(NotificationCompat.DEFAULT_ALL)
.setOnlyAlertOnce(true)
.build()
notificationManager.notify(info.packageName, NOTIFICATION_ID, notification)
Expand Down

0 comments on commit 47c4342

Please sign in to comment.