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

Commit 94c716ea authored by RoboErik's avatar RoboErik Committed by Erik Pasternak
Browse files

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
parent 2ae312e3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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");
                    }