noteViewAdClosed method
Records the ad's onAdClosed — the user left the ad's overlay/landing
page (2026-07 audit).
Not every click backgrounds the app: an in-app overlay (typical for iOS
banner clicks) opens and closes with NO foreground event ever firing, so
a bare latch would sit armed and silently eat the NEXT genuine warm
return — one lost app-open impression per overlay click. But the latch
cannot simply clear here either: on the external-browser flow (typical
Android), onAdClosed and the resume-driven foreground event both fire
around the same moment, in either order — clearing immediately would
re-open the exact ADR-042 hole. So a close starts a short grace clock
(viewAdCloseGrace): a foreground event within it still counts as the
return from the ad; after it, the latch is treated as expired.
Implementation
void noteViewAdClosed() {
if (_viewAdOpened) _viewAdClosedAt = _now();
}