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

Commit 5432355d authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Update sound/vibrate notification key only when it actually buzz/beep."

parents 172458e0 2ca1aec1
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -4807,22 +4807,25 @@ public class NotificationManagerService extends SystemService {
                    }
                    }
                    if (DBG) Slog.v(TAG, "Interrupting!");
                    if (DBG) Slog.v(TAG, "Interrupting!");
                    if (hasValidSound) {
                    if (hasValidSound) {
                        mSoundNotificationKey = key;
                        if (mInCall) {
                        if (mInCall) {
                            playInCallNotification();
                            playInCallNotification();
                            beep = true;
                            beep = true;
                        } else {
                        } else {
                            beep = playSound(record, soundUri);
                            beep = playSound(record, soundUri);
                        }
                        }
                        if(beep) {
                            mSoundNotificationKey = key;
                        }
                    }
                    }


                    final boolean ringerModeSilent =
                    final boolean ringerModeSilent =
                            mAudioManager.getRingerModeInternal()
                            mAudioManager.getRingerModeInternal()
                                    == AudioManager.RINGER_MODE_SILENT;
                                    == AudioManager.RINGER_MODE_SILENT;
                    if (!mInCall && hasValidVibrate && !ringerModeSilent) {
                    if (!mInCall && hasValidVibrate && !ringerModeSilent) {
                        mVibrateNotificationKey = key;

                        buzz = playVibration(record, vibration, hasValidSound);
                        buzz = playVibration(record, vibration, hasValidSound);
                        if(buzz) {
                            mVibrateNotificationKey = key;
                        }
                    }
                    }
                }
                }
            }
            }