Skip to content

Optimize UI event handling to reduce main thread saturation#8

Merged
BigfootACA merged 1 commit into
Droid-VM:masterfrom
lateautumn233:fix
May 17, 2026
Merged

Optimize UI event handling to reduce main thread saturation#8
BigfootACA merged 1 commit into
Droid-VM:masterfrom
lateautumn233:fix

Conversation

@lateautumn233
Copy link
Copy Markdown
Contributor

  • MainHomeFragment.onDaemonEvent: ignore output events
  • VMEventHandler.onDaemonEvent: short-circuit output before main-thread post
  • VM stdout/stderr/uart bursts no longer trigger home summary refresh or onVMStateChanged dispatch, fixing main thread saturation during VM boot

- MainHomeFragment.onDaemonEvent: ignore output events
- VMEventHandler.onDaemonEvent: short-circuit output before main-thread post
- VM stdout/stderr/uart bursts no longer trigger home summary refresh or
  onVMStateChanged dispatch, fixing main thread saturation during VM boot
Copilot AI review requested due to automatic review settings May 16, 2026 13:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces UI work caused by high-frequency VM output events during boot by preventing those events from triggering home summary refreshes or VM state callback dispatch.

Changes:

  • Filters output daemon events in MainHomeFragment.
  • Short-circuits output events in VMEventHandler before posting to the main thread.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
app/src/main/java/cn/classfun/droidvm/ui/main/home/MainHomeFragment.java Skips home refreshes for VM output events.
app/src/main/java/cn/classfun/droidvm/lib/daemon/VMEventHandler.java Avoids main-thread state dispatch for VM output events.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@BigfootACA BigfootACA merged commit 0902614 into Droid-VM:master May 17, 2026
4 of 5 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.

3 participants