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

Commit e94e90f0 authored by William Escande's avatar William Escande
Browse files

Update song position correctly

Some media players such as spotify update song position to -1.
But some vendors such as Audi can not update song position until
reconnection when receiving 0xFFFFFFFF.
Actually it is a possible number according to AVRCP SPEC but it causes
problems on the market.

Bug: 204097819
Fix: 204097819
Tag: #feature
Test: Build
Change-Id: I17c2069a27c3c1a902176a2cd013dd1ba36be78d
parent 6d0f8fb7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ public class PlayStatus {
    static final byte REV_SEEK = 4;
    static final byte ERROR = -1;

    public long position = 0xFFFFFFFFFFFFFFFFL;
    public long position = 0;
    public long duration = 0x00L;
    public byte state = STOPPED;

@@ -41,7 +41,7 @@ public class PlayStatus {
        if (state == null) return ret;

        ret.state = playbackStateToAvrcpState(state.getState());
        ret.position = state.getPosition();
        ret.position = (state.getPosition() > 0) ? state.getPosition() : 0;
        ret.duration = duration;
        return ret;
    }