Skip to content

android: lifecycle review follow-ups - #186

Merged
proggeramlug merged 1 commit into
mainfrom
fix/android-lifecycle-review
Nov 9, 2026
Merged

proggeramlug merged 1 commit into
mainfrom
fix/android-lifecycle-review

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Follow-ups to #182 from its last review round.

  • A window set only through bloom_android_set_native_window (Perry's host path) is the current one too, so the first frame keeps it instead of dropping the surface.
  • The surface's GPU work (dropping, creating, configuring) runs outside the lifecycle lock, so nativeSurfaceLost / nativeSetSurface never wait on a slow device idle. The game thread takes a window over under the lock before using it, so the UI thread can't release it meanwhile.
  • nativeSetSurface releases the extra reference when it hands over a window already held.
  • The finger that went down first drives mouse button 0 until it lifts; its POINTER_UP releases the button.
  • Audio stays paused when the surface wait ends for a close request.
  • The logcat reader retries an interrupted read, logs a partial last line at EOF and closes its end.
  • nativeMain clears a close request left by an earlier Activity in the same process.

Tested on a Pixel 4a: launch, background and resume (twice), taps, Back.

- A window set only through bloom_android_set_native_window is the current
  one too, so the first frame keeps it.
- The surface's GPU work (dropping, creating, configuring) runs outside the
  lifecycle lock, so nativeSurfaceLost/nativeSetSurface never wait on it;
  the game thread takes a window over under the lock before using it.
- nativeSetSurface releases the extra reference when it hands over a window
  already held.
- The finger that went down first drives mouse button 0 until it lifts
  (POINTER_UP of that finger releases it).
- Audio stays paused when the surface wait ends for a close request.
- The logcat reader retries an interrupted read, logs a partial last line
  at EOF and closes its end.
- nativeMain clears a close request left by an earlier Activity.
@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d9574469-6f92-493f-ada8-3a820817210e
Commits

Reviewing files that changed from the base of the PR and between bcae9c2 and 7573fdd.

Files selected for processing: 1

  • native/android/src/lib.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@proggeramlug
proggeramlug merged commit 9a96687 into main Nov 9, 2026
68 of 70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant