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

Commit f07317de authored by Zhihai Xu's avatar Zhihai Xu Committed by Android (Google) Code Review
Browse files

Merge "fix incorrect track position reported from BT AVRCP"

parents 2fc0de05 ad29149d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -464,13 +464,15 @@ final class Avrcp {
            mCurrentPosMs = getPlayPosition();
        }

        mCurrentPlayState = state;
        if (currentPosMs != RemoteControlClient.PLAYBACK_POSITION_INVALID) {
            mCurrentPosMs = currentPosMs;
        }
        if (state == RemoteControlClient.PLAYSTATE_PLAYING) {
        if ((state == RemoteControlClient.PLAYSTATE_PLAYING) &&
            ((currentPosMs != RemoteControlClient.PLAYBACK_POSITION_INVALID) ||
            (mCurrentPlayState != RemoteControlClient.PLAYSTATE_PLAYING))) {
            mPlayStartTimeMs = SystemClock.elapsedRealtime();
        }
        mCurrentPlayState = state;

        boolean newPosValid = (mCurrentPosMs !=
                               RemoteControlClient.PLAYBACK_POSITION_ALWAYS_UNKNOWN);