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

Commit c1506c3e authored by Joseph Pirozzo's avatar Joseph Pirozzo
Browse files

Limit AVRCP Browsing fetch size

Limit the size of AVRCP Browsing transactions to improve performance and
reliability for large folders.

Bug: 79093111
Test: Browse a folder with more than 1000 songs.
Change-Id: I49919a72b39acf2bc443e630d32435a76e3115e7
parent b7e21375
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -91,8 +91,10 @@ class AvrcpControllerStateMachine extends StateMachine {

    static final int ABS_VOL_TIMEOUT_MILLIS = 1000; //1s
    static final int CMD_TIMEOUT_MILLIS = 5000; // 5s
    // Fetch only 5 items at a time.
    static final int GET_FOLDER_ITEMS_PAGINATION_SIZE = 5;
    // Fetch only 20 items at a time.
    static final int GET_FOLDER_ITEMS_PAGINATION_SIZE = 20;
    // Fetch no more than 1000 items per directory.
    static final int MAX_FOLDER_ITEMS = 1000;

    /*
     * Base value for absolute volume from JNI
@@ -590,7 +592,7 @@ class AvrcpControllerStateMachine extends StateMachine {
                Log.d(STATE_TAG, "startInd " + startInd + " endInd " + endInd);
            }
            mStartInd = startInd;
            mEndInd = endInd;
            mEndInd = Math.min(endInd, MAX_FOLDER_ITEMS);
        }

        @Override