am 8515256a: Merge "Handle seek requests in AudioService" into jb-mr2-dev
* commit '8515256ad477721a97108745da4c86f378f50637': Handle seek requests in AudioService
This commit is contained in:
@@ -3534,6 +3534,9 @@ public class AudioService extends IAudioService.Stub implements OnFinished {
|
||||
onNewPlaybackStateForRcc(msg.arg1 /* rccId */, msg.arg2 /* state */,
|
||||
(RccPlaybackState)msg.obj /* newState */);
|
||||
break;
|
||||
case MSG_RCC_SEEK_REQUEST:
|
||||
onSetRemoteControlClientPlaybackPosition(msg.arg1 /* generationId */,
|
||||
((Long)msg.obj).longValue() /* timeMs */);
|
||||
|
||||
case MSG_SET_RSX_CONNECTION_STATE:
|
||||
onSetRsxConnectionState(msg.arg1/*available*/, msg.arg2/*address*/);
|
||||
@@ -5867,7 +5870,16 @@ public class AudioService extends IAudioService.Stub implements OnFinished {
|
||||
}
|
||||
|
||||
public void setRemoteControlClientPlaybackPosition(int generationId, long timeMs) {
|
||||
sendMsg(mAudioHandler, MSG_RCC_SEEK_REQUEST, SENDMSG_QUEUE, generationId /* arg1 */,
|
||||
// ignore position change requests if invalid generation ID
|
||||
synchronized(mRCStack) {
|
||||
synchronized(mCurrentRcLock) {
|
||||
if (mCurrentRcClientGen != generationId) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
// discard any unprocessed seek request in the message queue, and replace with latest
|
||||
sendMsg(mAudioHandler, MSG_RCC_SEEK_REQUEST, SENDMSG_REPLACE, generationId /* arg1 */,
|
||||
0 /* arg2 ignored*/, new Long(timeMs) /* obj */, 0 /* delay */);
|
||||
}
|
||||
|
||||
|
||||
@@ -683,9 +683,12 @@ public class RemoteControlClient
|
||||
/**
|
||||
* Called on the implementer to notify it that the playback head should be set at the given
|
||||
* position. If the position can be changed from its current value, the implementor of
|
||||
* the interface should also update the playback position using
|
||||
* the interface must also update the playback position using
|
||||
* {@link RemoteControlClient#setPlaybackState(int, long, int)} to reflect the actual new
|
||||
* position being used, regardless of whether it differs from the requested position.
|
||||
* Failure to do so would cause the system to not know the new actual playback position,
|
||||
* and user interface components would fail to show the user where playback resumed after
|
||||
* the position was updated.
|
||||
* @param newPositionMs the new requested position in the current media, expressed in ms.
|
||||
*/
|
||||
void onPlaybackPositionUpdate(long newPositionMs);
|
||||
|
||||
Reference in New Issue
Block a user