Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restyle Address cert test case issues #19255

Merged
merged 3 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ public int request(int cmd, long parameter) {
Log.d(TAG, "request pause at " + endpoint);
playbackState = PLAYBACK_STATE_PAUSED;
playbackSpeed = 0;

return RESPONSE_STATUS_SUCCESS;

case REQUEST_STOP:
Log.d(TAG, "request stop at " + endpoint);
playbackState = PLAYBACK_STATE_NOT_PLAYING;
playbackSpeed = 0;

return RESPONSE_STATUS_SUCCESS;

case REQUEST_START_OVER:
Expand Down Expand Up @@ -131,14 +131,20 @@ public int request(int cmd, long parameter) {
case REQUEST_SKIP_FORWARD:
Log.d(TAG, "request skip forward " + parameter + " milliseconds at " + endpoint);
newPosition = playbackPosition + parameter;
playbackPosition = (newPosition > playbackDuration) ? playbackDuration : (newPosition >= 0 ? newPosition : 0);
playbackPosition =
(newPosition > playbackDuration)
? playbackDuration
: (newPosition >= 0 ? newPosition : 0);

return RESPONSE_STATUS_SUCCESS;

case REQUEST_SKIP_BACKWARD:
Log.d(TAG, "request skip backward " + parameter + " milliseconds at " + endpoint);
newPosition = playbackPosition - parameter;
playbackPosition = (newPosition > playbackDuration) ? playbackDuration : (newPosition >= 0 ? newPosition : 0);
playbackPosition =
(newPosition > playbackDuration)
? playbackDuration
: (newPosition >= 0 ? newPosition : 0);

return RESPONSE_STATUS_SUCCESS;

Expand All @@ -150,7 +156,6 @@ public int request(int cmd, long parameter) {
} else {
playbackPosition = parameter;
}


return RESPONSE_STATUS_SUCCESS;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ uint64_t MediaPlaybackManager::HandleGetSeekRangeEnd()
void MediaPlaybackManager::HandlePlay(CommandResponseHelper<Commands::PlaybackResponse::Type> & helper)
{
// TODO: Insert code here
mCurrentState = PlaybackStateEnum::kPlaying;
mCurrentState = PlaybackStateEnum::kPlaying;
mPlaybackSpeed = 1;

Commands::PlaybackResponse::Type response;
Expand All @@ -73,7 +73,7 @@ void MediaPlaybackManager::HandlePlay(CommandResponseHelper<Commands::PlaybackRe
void MediaPlaybackManager::HandlePause(CommandResponseHelper<Commands::PlaybackResponse::Type> & helper)
{
// TODO: Insert code here
mCurrentState = PlaybackStateEnum::kPaused;
mCurrentState = PlaybackStateEnum::kPaused;
mPlaybackSpeed = 0;

Commands::PlaybackResponse::Type response;
Expand All @@ -85,7 +85,7 @@ void MediaPlaybackManager::HandlePause(CommandResponseHelper<Commands::PlaybackR
void MediaPlaybackManager::HandleStop(CommandResponseHelper<Commands::PlaybackResponse::Type> & helper)
{
// TODO: Insert code here
mCurrentState = PlaybackStateEnum::kNotPlaying;
mCurrentState = PlaybackStateEnum::kNotPlaying;
mPlaybackSpeed = 0;
mPlaybackPosition = { 0, chip::app::DataModel::Nullable<uint64_t>(0) };

Expand Down