Skip to content
Snippets Groups Projects
Commit de0d9e38 authored by wumin3's avatar wumin3
Browse files

NotificationPlayer: use AUDIOFOCUS_GAIN_TRANSIENT instead of AUDIOFOCUS_GAIN in looping mode


A voip app will usually use notification with FLAG_INSISTENT when a new voip call comes, if the duration hint was AUDIOFOCUS_GAIN the music app will not continue after the voip call end.

Signed-off-by: default avatarwumin3 <wumin3@xiaomi.com>
Change-Id: I6270bb08181b8fb94c84ec0f69bd226f3a7d0f01
parent edc13cc2
No related branches found
No related tags found
No related merge requests found
......@@ -112,7 +112,7 @@ public class NotificationPlayer implements OnCompletionListener, OnErrorListener
if (DEBUG) Log.d(mTag, "requesting AudioFocus");
int focusGain = AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK;
if (mCmd.looping) {
focusGain = AudioManager.AUDIOFOCUS_GAIN;
focusGain = AudioManager.AUDIOFOCUS_GAIN_TRANSIENT;
}
mNotificationRampTimeMs = audioManager.getFocusRampTimeMs(
focusGain, mCmd.attributes);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment