diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java
index 5305ae5a4..d73f5d98b 100644
--- a/src/main/java/eu/siacs/conversations/services/NotificationService.java
+++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java
@@ -283,6 +283,7 @@ public class NotificationService {
final String ringtone = preferences.getString("notification_ringtone", null);
final boolean vibrate = preferences.getBoolean("vibrate_on_notification", true);
final boolean led = preferences.getBoolean("led", true);
+ final boolean headsup = preferences.getBoolean("notification_headsup", mXmppConnectionService.getResources().getBoolean(R.bool.headsup_notifications));
if (notify && !isQuietHours()) {
if (vibrate) {
final int dat = 70;
@@ -303,7 +304,7 @@ public class NotificationService {
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
mBuilder.setCategory(Notification.CATEGORY_MESSAGE);
}
- mBuilder.setPriority(notify ? NotificationCompat.PRIORITY_DEFAULT : NotificationCompat.PRIORITY_LOW);
+ mBuilder.setPriority(notify ? (headsup ? NotificationCompat.PRIORITY_HIGH : NotificationCompat.PRIORITY_DEFAULT) : NotificationCompat.PRIORITY_LOW);
setNotificationColor(mBuilder);
mBuilder.setDefaults(0);
if (led) {
diff --git a/src/main/res/values/defaults.xml b/src/main/res/values/defaults.xml
index 66dfdf347..66601cfee 100644
--- a/src/main/res/values/defaults.xml
+++ b/src/main/res/values/defaults.xml
@@ -4,4 +4,5 @@
true
false
false
-
\ No newline at end of file
+ false
+
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index ccd556b2c..f27ad0d3d 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -752,4 +752,6 @@
Server requires registration on website
Open website
No application found to open website
+ Heads-up Notifications
+ Show Heads-up Notifications
diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml
index 684b98136..6c6d592f8 100644
--- a/src/main/res/xml/preferences.xml
+++ b/src/main/res/xml/preferences.xml
@@ -66,6 +66,12 @@
android:ringtoneType="notification"
android:summary="@string/pref_sound_summary"
android:title="@string/pref_sound"/>
+