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

Commit 44d4be01 authored by kai's avatar kai
Browse files

AvrcpCtrSM send INTERNAL_CMD_TIMEOUT

When we go to MoveToRoot and GetFolderList state, we should send
MESSAGE_INTERNAL_CMD_TIMEOUT. So we can go back to the mConnected
state, if we do not get the response or timed out to execute the
request.

Bug: 68018990

Test: 1 Select any song and start playing
      2 Change song track while browsing playlists
Change-Id: I1426a1410c736674ec8731e5ff2cec7835a545a1
(cherry picked from commit 0ccfb23b360dde05deaa9f4b3a60db701db9e52c)
parent 8cbea42f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -544,9 +544,10 @@ class AvrcpControllerStateMachine extends StateMachine {

        @Override
        public void enter() {
            // Setup the timeouts.
            super.enter();
            mCurrInd = 0;
            mFolderList.clear();

            callNativeFunctionForScope(mStartInd,
                    Math.min(mEndInd, mStartInd + GET_FOLDER_ITEMS_PAGINATION_SIZE - 1));
        }
@@ -745,6 +746,11 @@ class AvrcpControllerStateMachine extends StateMachine {
                    sendMessage(MESSAGE_INTERNAL_MOVE_N_LEVELS_UP);
                    break;

                case MESSAGE_INTERNAL_CMD_TIMEOUT:
                    broadcastFolderList(BrowseTree.ROOT, EMPTY_MEDIA_ITEM_LIST);
                    transitionTo(mConnected);
                    break;

                default:
                    Log.d(STATE_TAG, "deferring message " + msg + " to connected!");
                    deferMessage(msg);