mirror of
https://github.com/androidx/media.git
synced 2025-05-09 16:40:55 +08:00

We currently start the timeout as soon as the player enters the target ad, but that ad hasn't loaded yet (= at the point where we actively start waiting for it). And then we try to clear the timeout at various places that mean we are no longer waiting for this ad. This is very error-prone though because there are a lot of places in the AdTagLoader that change the AdPlaybackState and could mark the ad as skipped, failed or loaded. A much less error-prone way of clearing the timeout is not even try to find all places that may revert the wait condition and instead just check if we are still waiting at the point of executing the timeout message. PiperOrigin-RevId: 748291720