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

This commit is contained in:
Treehugger Robot
2019-01-03 20:51:22 +00:00
committed by Gerrit Code Review

View File

@@ -4807,22 +4807,25 @@ public class NotificationManagerService extends SystemService {
}
if (DBG) Slog.v(TAG, "Interrupting!");
if (hasValidSound) {
mSoundNotificationKey = key;
if (mInCall) {
playInCallNotification();
beep = true;
} else {
beep = playSound(record, soundUri);
}
if(beep) {
mSoundNotificationKey = key;
}
}
final boolean ringerModeSilent =
mAudioManager.getRingerModeInternal()
== AudioManager.RINGER_MODE_SILENT;
if (!mInCall && hasValidVibrate && !ringerModeSilent) {
mVibrateNotificationKey = key;
buzz = playVibration(record, vibration, hasValidSound);
if(buzz) {
mVibrateNotificationKey = key;
}
}
}
}