forked from mirror/monocles_chat_clean
use variable for vibration pattern (Christian Schneppe)
This commit is contained in:
parent
ea4a29a844
commit
d6cb4e208d
1 changed files with 5 additions and 9 deletions
|
@ -98,6 +98,8 @@ public class NotificationService {
|
||||||
|
|
||||||
private static final String MESSAGES_GROUP = "eu.siacs.conversations.messages";
|
private static final String MESSAGES_GROUP = "eu.siacs.conversations.messages";
|
||||||
private static final String MISSED_CALLS_GROUP = "eu.siacs.conversations.missed_calls";
|
private static final String MISSED_CALLS_GROUP = "eu.siacs.conversations.missed_calls";
|
||||||
|
private static final int MESSAGE_DAT = 70;
|
||||||
|
private static final long[] MESSAGE_PATTERN = {0, 3 * MESSAGE_DAT, MESSAGE_DAT, MESSAGE_DAT};
|
||||||
private static final int NOTIFICATION_ID_MULTIPLIER = 1024 * 1024;
|
private static final int NOTIFICATION_ID_MULTIPLIER = 1024 * 1024;
|
||||||
public static final int NOTIFICATION_ID = 2 * NOTIFICATION_ID_MULTIPLIER;
|
public static final int NOTIFICATION_ID = 2 * NOTIFICATION_ID_MULTIPLIER;
|
||||||
public static final int FOREGROUND_NOTIFICATION_ID = NOTIFICATION_ID_MULTIPLIER * 4;
|
public static final int FOREGROUND_NOTIFICATION_ID = NOTIFICATION_ID_MULTIPLIER * 4;
|
||||||
|
@ -331,9 +333,7 @@ public class NotificationService {
|
||||||
.setUsage(AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_INSTANT)
|
.setUsage(AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_INSTANT)
|
||||||
.build());
|
.build());
|
||||||
messagesChannel.setLightColor(LED_COLOR);
|
messagesChannel.setLightColor(LED_COLOR);
|
||||||
final int dat = 70;
|
messagesChannel.setVibrationPattern(MESSAGE_PATTERN);
|
||||||
final long[] pattern = {0, 3 * dat, dat, dat};
|
|
||||||
messagesChannel.setVibrationPattern(pattern);
|
|
||||||
messagesChannel.enableVibration(true);
|
messagesChannel.enableVibration(true);
|
||||||
messagesChannel.enableLights(true);
|
messagesChannel.enableLights(true);
|
||||||
notificationManager.createNotificationChannelGroup(new NotificationChannelGroup(INDIVIDUAL_NOTIFICATION_PREFIX + name + uuid, name + " (" + jid + ")"));
|
notificationManager.createNotificationChannelGroup(new NotificationChannelGroup(INDIVIDUAL_NOTIFICATION_PREFIX + name + uuid, name + " (" + jid + ")"));
|
||||||
|
@ -358,9 +358,7 @@ public class NotificationService {
|
||||||
.setUsage(AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_INSTANT)
|
.setUsage(AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_INSTANT)
|
||||||
.build());
|
.build());
|
||||||
messagesChannel.setLightColor(LED_COLOR);
|
messagesChannel.setLightColor(LED_COLOR);
|
||||||
final int dat = 70;
|
messagesChannel.setVibrationPattern(MESSAGE_PATTERN);
|
||||||
final long[] pattern = {0, 3 * dat, dat, dat};
|
|
||||||
messagesChannel.setVibrationPattern(pattern);
|
|
||||||
messagesChannel.enableVibration(true);
|
messagesChannel.enableVibration(true);
|
||||||
messagesChannel.enableLights(true);
|
messagesChannel.enableLights(true);
|
||||||
messagesChannel.setGroup("chats");
|
messagesChannel.setGroup("chats");
|
||||||
|
@ -991,9 +989,7 @@ public class NotificationService {
|
||||||
final boolean headsup = preferences.getBoolean("notification_headsup", resources.getBoolean(R.bool.headsup_notifications));
|
final boolean headsup = preferences.getBoolean("notification_headsup", resources.getBoolean(R.bool.headsup_notifications));
|
||||||
if (notify && !quietHours) {
|
if (notify && !quietHours) {
|
||||||
if (vibrate) {
|
if (vibrate) {
|
||||||
final int dat = 70;
|
mBuilder.setVibrate(MESSAGE_PATTERN);
|
||||||
final long[] pattern = {0, 3 * dat, dat, dat};
|
|
||||||
mBuilder.setVibrate(pattern);
|
|
||||||
} else {
|
} else {
|
||||||
mBuilder.setVibrate(new long[]{0});
|
mBuilder.setVibrate(new long[]{0});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue