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

Commit 2143e5de authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Don't play notification audio in vibrate mode

Bug: 34254134
Test: manual
Change-Id: Iac9183b98a699fba26dac24d446f94723c36cb60
parent 1f6df68a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3289,7 +3289,9 @@ public class NotificationManagerService extends SystemService {
    private boolean playSound(final NotificationRecord record, Uri soundUri) {
        boolean looping = (record.getNotification().flags & Notification.FLAG_INSISTENT) != 0;
        // do not play notifications if there is a user of exclusive audio focus
        if (!mAudioManager.isAudioFocusExclusive()) {
        // or the device is in vibrate mode
        if (!mAudioManager.isAudioFocusExclusive() && mAudioManager.getRingerModeInternal()
                != AudioManager.RINGER_MODE_VIBRATE) {
            final long identity = Binder.clearCallingIdentity();
            try {
                final IRingtonePlayer player = mAudioManager.getRingtonePlayer();