google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.02k forks source link

Update FakeClock.java #11365

Closed Jx1yG closed 8 months ago

Jx1yG commented 9 months ago

Constructor Parameters: Added Parameters: Introduced two new parameters in the FakeClock constructor. clockSpeed: Represents the speed at which the clock advances time. A value of 1.0 indicates real-time, and higher values accelerate time. messageExecutionDelayMs: Represents the delay introduced between triggering a message and executing its associated code.

Logging in advanceTime Method: Added Logging: Inserted logging statements in the advanceTime method to provide information about the amount of time by which the clock is advanced.

Clock Speed Configuration: New Variable (clockSpeed): Introduced a new variable, clockSpeed, to the FakeClock class to control the speed at which time progresses. This allows for configurable clock speeds, facilitating scenarios where time can pass at different rates.

Modified advanceTimeInternal: Adjusted the advanceTimeInternal method to consider the clockSpeed when updating the simulated time. This modification ensures that time is advanced at the specified speed.

Message Execution Delay Configuration:

New Variable (messageExecutionDelayMs): Added a new variable, messageExecutionDelayMs, to control the delay between triggering a message and executing its associated code.

Modified HandlerMessage Class: Altered the HandlerMessage class to introduce a delay before executing the message. The maybeTriggerMessage method now utilizes the postDelayed method to achieve the specified delay.

google-cla[bot] commented 9 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

oceanjules commented 8 months ago

@Jx1yG, Please be aware that this project has now been deprecated and there will not be any more releases. You can instead raise a PR in our new project over in androidx/media which has the FakeClock that you want to update. Thanks!