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

Commit a4d4c8e5 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge "Merge "NotificationManagerService: don't play notif in SILENT mode"...

Merge "Merge "NotificationManagerService: don't play notif in SILENT mode" into pi-dev am: a908ec2a am: 0babc73c"
parents f9767031 0af55843
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -4692,10 +4692,11 @@ 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
        // or the device is in vibrate mode
        if (!mAudioManager.isAudioFocusExclusive() && (mAudioManager.getRingerModeInternal()
                != AudioManager.RINGER_MODE_VIBRATE || mAudioManager.getStreamVolume(
        // play notifications if there is no user of exclusive audio focus
        // and the stream volume is not 0 (non-zero volume implies not silenced by SILENT or
        //   VIBRATE ringer mode)
        if (!mAudioManager.isAudioFocusExclusive()
                && (mAudioManager.getStreamVolume(
                        AudioAttributes.toLegacyStreamType(record.getAudioAttributes())) != 0)) {
            final long identity = Binder.clearCallingIdentity();
            try {