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

Commit 29d31dc9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Set active player to MediaKeyEventSession when init"

parents aed74b76 1501fe6f
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -196,7 +196,16 @@ public class MediaPlayerList {

                // If there were any active players and we don't already have one due to the Media
                // Framework Callbacks then set the highest priority one to active
                if (mActivePlayerId == 0 && mMediaPlayers.size() > 0) setActivePlayer(1);
                if (mActivePlayerId == 0 && mMediaPlayers.size() > 0) {
                    String packageName = mMediaSessionManager.getMediaKeyEventSessionPackageName();
                    if (!TextUtils.isEmpty(packageName) && haveMediaPlayer(packageName)) {
                        Log.i(TAG, "Set active player to MediaKeyEvent session = " + packageName);
                        setActivePlayer(mMediaPlayerIds.get(packageName));
                    } else {
                        Log.i(TAG, "Set active player to first default");
                        setActivePlayer(1);
                    }
                }
            });
    }