Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a1b7ec9 authored by Evan Charlton's avatar Evan Charlton
Browse files

Fix the logic around killing sound & vibrations for quiet hours.

The logic for quiet hours was wrong; this was causing sound & vibration
to be killed when it shouldn't be.

Change-Id: I7f3094de03e46c418f46608d46056005a1fb0684
parent 61be3875
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -861,7 +861,8 @@ class NotificationManagerService extends INotificationManager.Stub
                // sound
                final boolean useDefaultSound =
                    (notification.defaults & Notification.DEFAULT_SOUND) != 0;
                if ((inQuietHours && !mQuietHoursMute) && (useDefaultSound || notification.sound != null)) {
                if (!(inQuietHours && mQuietHoursMute)
                        && (useDefaultSound || notification.sound != null)) {
                    Uri uri;
                    if (useDefaultSound) {
                        uri = Settings.System.DEFAULT_NOTIFICATION_URI;
@@ -892,7 +893,8 @@ class NotificationManagerService extends INotificationManager.Stub
                // vibrate
                final boolean useDefaultVibrate =
                    (notification.defaults & Notification.DEFAULT_VIBRATE) != 0;
                if ((inQuietHours && !mQuietHoursStill) && (useDefaultVibrate || notification.vibrate != null)
                if (!(inQuietHours && mQuietHoursStill)
                        && (useDefaultVibrate || notification.vibrate != null)
                        && audioManager.shouldVibrate(AudioManager.VIBRATE_TYPE_NOTIFICATION)) {
                    mVibrateNotification = r;