Relex callback barrier
The PlaybackService will notify GUI elements about state changes. However: These callbacks are async and the gui may already have updated its own state, so the code checks for 'old' RPCs. This fails on fast devices, where click -> service -> state-change -> callback takes less than 1ms The new code relexes this and accepts messages with the same timestamp
This commit is contained in:
parent
d42bd1c252
commit
37527e17cc
@ -257,7 +257,7 @@ public abstract class PlaybackActivity extends Activity
|
|||||||
*/
|
*/
|
||||||
public void setState(long uptime, int state)
|
public void setState(long uptime, int state)
|
||||||
{
|
{
|
||||||
if (uptime > mLastStateEvent)
|
if (uptime >= mLastStateEvent)
|
||||||
setState(state);
|
setState(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,7 +311,7 @@ public abstract class PlaybackActivity extends Activity
|
|||||||
*/
|
*/
|
||||||
public void setSong(long uptime, Song song)
|
public void setSong(long uptime, Song song)
|
||||||
{
|
{
|
||||||
if (uptime > mLastSongEvent)
|
if (uptime >= mLastSongEvent)
|
||||||
setSong(song);
|
setSong(song);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user