Route volume commands whenever media stream is in use
Found a regression in volume handling. Previously we handled volume commands as long as the media stream was active but we were only handling them when there was an active session on L. This adds a check to make sure we handle volume if anything is playing on the media stream. bug:17498479 Change-Id: Iddd745c8a762cf7ebedb37f1b26fc934db01fba0
This commit is contained in:
@@ -31,6 +31,7 @@ import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.ContentObserver;
|
||||
import android.media.AudioManager;
|
||||
import android.media.AudioSystem;
|
||||
import android.media.IAudioService;
|
||||
import android.media.IRemoteVolumeController;
|
||||
import android.media.session.IActiveSessionsListener;
|
||||
@@ -800,7 +801,8 @@ public class MediaSessionService extends SystemService implements Monitor {
|
||||
|
||||
}
|
||||
if (session == null) {
|
||||
if ((flags & AudioManager.FLAG_ACTIVE_MEDIA_ONLY) != 0) {
|
||||
if ((flags & AudioManager.FLAG_ACTIVE_MEDIA_ONLY) != 0
|
||||
&& !AudioSystem.isStreamActive(AudioManager.STREAM_MUSIC, 0)) {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "No active session to adjust, skipping media only volume event");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user