Skip to content

Drain Android background events in bounded batches per frame #2179

Closed

Description

@giswqs

Android MainActivity.takeEvents() joins and clears the entire event deque in one call. A long background track can leave up to 200,000 events, so returning to the foreground creates a large Java string, copies it through JNI, and parses it during one UI frame. The queue is bounded, but the frame work still scales with the whole retained track.

Drain a bounded batch per frame, preserve event order and eventual delivery, and request another frame while events remain. Keep dropped-position notices counted exactly once and retain non-position events such as picked files and failures. Add coverage for several batches, interleaved event kinds and queue overflow, plus a real Android foreground-resume check.

Part of #1902. Confirmed against main d03c1a57 during the release quality sweep. Source: #2024 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions