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

Commit b8470d21 authored by Ian Baker's avatar Ian Baker Committed by Android (Google) Code Review
Browse files

Merge "Remove launched flag logic in MediaSessionService" into main

parents abf3d819 dc611db4
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -3,13 +3,6 @@ container: "system"

# Flags are ordered alphabetically by name.

flag {
    name: "adjust_volume_for_foreground_app_playing_audio_without_media_session"
    namespace: "media_solutions"
    description: "Gates whether to adjust local stream volume when the app in the foreground is the last app to play audio or adjust the volume of the last active media session that the user interacted with."
    bug: "275185436"
}

flag {
    name: "clean_up_dead_router_records_after_unbinding"
    namespace: "media_better_together"
@@ -243,13 +236,6 @@ flag {
    bug: "307723189"
}

flag {
    name: "fallback_to_default_handling_when_media_session_has_fixed_volume_handling"
    namespace: "media_solutions"
    description: "Fallbacks to the default handling for volume adjustment when media session has fixed volume handling and its app is in the foreground and setting a media controller."
    bug: "293743975"
}

flag {
    name: "enable_output_switcher_personal_audio_sharing"
    namespace: "cross_device_experiences"
+7 −13
Original line number Diff line number Diff line
@@ -2259,8 +2259,7 @@ public class MediaSessionService extends SystemService implements Monitor {
                                keyEvent, AudioManager.USE_DEFAULT_STREAM_TYPE, false);
                        return;
                    }
                    if (Flags.fallbackToDefaultHandlingWhenMediaSessionHasFixedVolumeHandling()
                            && !record.canHandleVolumeKey()) {
                    if (!record.canHandleVolumeKey()) {
                        Log.d(TAG, "Session with packageName=" + record.getPackageName()
                                + " doesn't support volume adjustment."
                                + " Fallbacks to the default handling.");
@@ -2558,17 +2557,12 @@ public class MediaSessionService extends SystemService implements Monitor {

            if (session != null && session.getUid() != uid
                    && mAudioPlayerStateMonitor.hasUidPlayedAudioLast(uid)) {
                if (Flags.adjustVolumeForForegroundAppPlayingAudioWithoutMediaSession()) {
                // The app in the foreground has been the last app to play media locally.
                    // Therefore, We ignore the chosen session so that volume events affect the
                    // local music stream instead. See b/275185436 for details.
                // Therefore, we ignore the chosen session so that volume events affect the local
                // music stream instead. See b/275185436 for details.
                Log.d(TAG, "Ignoring session=" + session + " and adjusting suggestedStream="
                        + suggestedStream + " instead");
                session = null;
                } else {
                    Log.d(TAG, "Session=" + session + " will not be not ignored and will receive"
                            + " the volume adjustment event");
                }
            }

            if (session == null || preferSuggestedStream) {