Merge "NotificationPlayer: use AUDIOFOCUS_GAIN_TRANSIENT instead of AUDIOFOCUS_GAIN in looping mode"

This commit is contained in:
Beth Thibodeau
2022-07-13 15:58:46 +00:00
committed by Gerrit Code Review

View File

@@ -112,7 +112,7 @@ public class NotificationPlayer implements OnCompletionListener, OnErrorListener
if (DEBUG) Log.d(mTag, "requesting AudioFocus"); if (DEBUG) Log.d(mTag, "requesting AudioFocus");
int focusGain = AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK; int focusGain = AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK;
if (mCmd.looping) { if (mCmd.looping) {
focusGain = AudioManager.AUDIOFOCUS_GAIN; focusGain = AudioManager.AUDIOFOCUS_GAIN_TRANSIENT;
} }
mNotificationRampTimeMs = audioManager.getFocusRampTimeMs( mNotificationRampTimeMs = audioManager.getFocusRampTimeMs(
focusGain, mCmd.attributes); focusGain, mCmd.attributes);