Fix rewarded end card close button staying hidden when reward already granted - #1005
Open
mdanylov-sigma wants to merge 1 commit into
Open
mdanylov-sigma wants to merge 1 commit into
mdanylov-sigma wants to merge 1 commit into
Conversation
… granted AdInterstitialDialog.setUpCloseButtonTask() returned early when RewardManager.getUserRewardedAlready() was already true, without ever scheduling the close button to appear. For a VAST rewarded ad with an end card where the reward is granted during video playback, the end card's close button (default View.GONE) then never became visible, leaving the user stuck with no way to close the ad except backgrounding/killing the app. Now, when the user is already rewarded on entry, the close button is explicitly scheduled via scheduleCloseButtonDisplaying(), honoring the close.action/postrewardtime rules instead of just returning. Fixes #1004 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1004.
AdInterstitialDialog.setUpCloseButtonTask()returned early whenRewardManager.getUserRewardedAlready()was alreadytrue, without ever scheduling the close button to appear (it defaults toView.GONE).For a VAST rewarded ad with an end card:
AdInterstitialDialog.setUpCloseButtonTask()hit the early return, so the close button was never scheduled — it stayedGONEfor the lifetime of the end card, with no way to close the ad other than backgrounding/killing the app.Fix
When the user is already rewarded on entry, the close button is now explicitly scheduled via
scheduleCloseButtonDisplaying(), honoring theclose.action/close.postrewardtimerules, instead of returning without any UI update.Testing
setUpCloseButton_userAlreadyRewardedinAdInterstitialDialogTestto assert the close button is scheduled (respectingpostRewardTime/autoClose) instead of asserting nothing happens../gradlew :PrebidMobile-core:testDebugUnitTest --tests "org.prebid.mobile.rendering.interstitial.*"— all suites pass.🤖 Generated with Claude Code