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

Commit 798613b4 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

MediaControlProfile: Fix handling control point commands

Fix when control point command is received on inactive player.

Bug: 326528836
Flag: Exempt, trivial fix
Test: mmm packages/modules/Bluetooth
Change-Id: Ice3092988741a02ce88de022f5544c75a316ac1a
parent e0c0aef0
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -402,8 +402,14 @@ public class MediaControlProfile implements MediaControlServiceCallbacks {
                        + Request.Opcodes.toString(request.getOpcode()));
                        + Request.Opcodes.toString(request.getOpcode()));
        Request.Results status = Request.Results.COMMAND_CANNOT_BE_COMPLETED;
        Request.Results status = Request.Results.COMMAND_CANNOT_BE_COMPLETED;


        if (mMediaPlayerList.getActivePlayer() == null && mGMcsService != null) {
        if (mMediaPlayerList.getActivePlayer() == null || mCurrentData.state == null) {
            Log.w(TAG, "no active MediaPlayer or mCurrentData is null");
            if (mGMcsService != null) {
                mGMcsService.setMediaControlRequestResult(request, status);
                mGMcsService.setMediaControlRequestResult(request, status);
            } else {
                Log.e(TAG, "mGMcsService is null");
            }
            return;
        }
        }


        long actions = getCurrentPlayerSupportedActions();
        long actions = getCurrentPlayerSupportedActions();