Account Event Queue
Buffers account/diagnostic events and flushes them to the backend in batches.
Telemetry must never affect a payment flow: every method here is fire-and-forget and every failure — a full queue, a transport error, a per-event rejection — is swallowed. Nothing this type does can throw to, or block, a caller.
In-memory only, by design: there is no disk persistence, so events still queued when the process dies are lost. A flush started from handleAppBackgrounded is best-effort — a POST begun at that point races process death and may never complete.
flushHandler is the seam for testing against a non-prod backend: the queue itself never reads networking constants, so a test supplies its own handler instead of the production AccountEventsAPI.record default.
Constructors
Functions
Queues an event, flushing immediately once the size threshold is reached.
Best-effort flush when the app goes to the background. Not guaranteed delivery — see the type documentation.
Test-only inspection of what is currently queued, without triggering a flush.
Starts the size/time-based flush and app-backgrounding observers. Safe to call more than once, and safe to call from any thread: Lifecycle.addObserver requires the main thread, so registration is dispatched there rather than trusting every caller (this is invoked from com.framepayments.framesdk.FrameNetworking.initializeWithAPIKey, a plain function a host could call from a background thread).