Skip to content

Quad sometimes stays black: container never laid out after the app is brought to front #56

Closed as not planned

Description

@compot-dev

Seen in device testing (#53, AG-216 Android TV box, Android 10). Deferred: the time-boxed investigation did not find the root cause. #48 adds a mitigation.

Symptom: after Quad is turned on from the menu, the screen stays black. No cell starts a session (no Quad-N: surface ready log). Home → back fixes it.

State while it happens:

  • dumpsys activity top: the Quad LinearLayout is VISIBLE but its bounds are 0,0-0,0, and the rows and TextureViews are also 0×0 with the invalidated flag set. The cells' TextureViews therefore never get a SurfaceTexture.
  • ViewRoot: mTraversalScheduled=false: no layout pass is pending. The activity is mResumed=true mStopped=false. No ANR; the main thread is idle.

When: 3 of ~8 attempts, every time after am start … SEND was delivered to the already running activity (the task is brought to the front). On this box the launcher is also known to take focus about 1 s after such a start. It was never seen when Quad was entered without such a start. It may be specific to the test harness, but the app should recover anyway.

Mitigation in #48 (c332a2c): 500 ms after Quad is shown, if the container still has no size, the app forces a layout pass (forceLayout() up the chain, then requestLayout() + invalidate() on the decor view) and logs Quad layout did not happen, forcing a layout pass.

To do later: confirm whether the mitigation fires and is enough; find out why the layout request is lost.

Activity

  1. added
    bugSomething isn't working
    deferredPostponed, not planned for now
    in progressBeing worked on right now (open PR)
    on Oct 12, 2026
  2. compot-dev commented on Oct 12, 2026

    @compot-dev
    CollaboratorAuthor

    Re-test on the final v2 build 55f07ff (2026-10-12)

    AG-216, Android 10, three cameras in Quad, slot 4 empty.

    Scenario Runs Black Quad Mitigation fired (Quad layout did not happen)
    am start … SEND delivered to the running app → menu → Q 10 0 0
    Quad → Home → am start (task brought to front) 10 (1 lost to an ADB hiccup) 0 0

    Not reproducible any more. The fallback layout pass never had to run, so the container was laid out by the normal pass every time.

    I checked one hypothesis and it is ruled out: singleTop (cfbb492) is not what fixed it. The original failures were on 4660bba, which already had it. The root cause is still unknown; it is probably a timing race with the launcher taking focus right after the start, as noted above.

    The mitigation (c332a2c) stays in v2 and logs Quad layout did not happen, forcing a layout pass if it ever runs, so a recurrence will show up in a Device report logcat.

  3. compot-dev commented on Oct 12, 2026

    @compot-dev
    CollaboratorAuthor

    Closing as not reproducible (20 runs on 55f07ff, see above). The fallback layout pass stays in place and logs Quad layout did not happen, forcing a layout pass; if that line shows up in a Device report, reopen this issue.

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

    bugSomething isn't workingdeferredPostponed, not planned for now

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions