mCurrentPlayState = RemoteControlClient.PLAYSTATE_NONE; // until we get a callback
mPlayStatusChangedNT = NOTIFICATION_TYPE_CHANGED;
mTrackChangedNT = NOTIFICATION_TYPE_CHANGED;
- mTrackNumber = 0L;
+ mTrackNumber = -1L;
mCurrentPosMs = RemoteControlClient.PLAYBACK_POSITION_INVALID;
mPlayStartTimeMs = -1L;
mSongLengthMs = 0L;
private void sendTrackChangedRsp() {
byte[] track = new byte[TRACK_ID_SIZE];
+ /* track is stored in big endian format */
for (int i = 0; i < TRACK_ID_SIZE; ++i) {
- track[i] = (byte) (mTrackNumber >> (8 * i));
+ track[i] = (byte) (mTrackNumber >> (56 - 8 * i));
}
registerNotificationRspTrackChangeNative(mTrackChangedNT, track);
}
break;
case RemoteControlClient.PLAYSTATE_STOPPED:
+ case RemoteControlClient.PLAYSTATE_NONE:
playStatus = PLAYSTATUS_STOPPED;
break;
break;
case RemoteControlClient.PLAYSTATE_ERROR:
- case RemoteControlClient.PLAYSTATE_NONE:
playStatus = PLAYSTATUS_ERROR;
break;