Repository navigation
开机设置做完才报运行中;带窗口开机时盖一层开机画面 - #217
Merged
Merged
Conversation
status / list / info / MCP report starting (busy starting too) from Android's boot until the setup of that boot is done, at most 60 s after the start began it; a record in avd\.mas_<i>.ready (qemu PID + creation time, step, percent) carries it across processes. New fields setup_step, setup_progress, setup_unfinished. A qemu no start sets up, a start that was cancelled or killed, and the cap never leave it at starting. Refs ModAVD/ModAVD#259
…lock probe The 60 s wait of the after-boot setup counts on the machine's millisecond counter (a deadline fixed once, shared by the readers and the log line), not the wall clock. A start deletes the earlier boot's record before it writes its own; a record that cannot be written is not tracked (warned, status does not wait), and the setup marker's heartbeat bounds the wait before the record exists. A take-over starts a record when it is about to do real work (first-boot setup, installing the host input method). Queries probe the start / stop / boot locks with a shared lock so concurrent queries never take each other for a start; the record names its writer process and the guest boot_id (read only while a record that is not done would hold the instance). Cancelling the /sdcard wait is not a completed setup. The step goes back to tune after the named steps; creating / create_failed clear the setup fields. Refs ModAVD/ModAVD#259
…nline (Windows) A windowed start (the command line's and the manager's) starts a small process of the same executable, `__bootoverlay`, that lays a pop-up owned by the emulator's main window over its picture area and one over the side toolbar, shows the brand avatar, a progress bar and a line of what is being done, and disables the emulator's windows (EnableWindow) so the keyboard cannot reach them either. It reads what status reads (the setup record, the start lock, one getprop), takes the cover away at the moment status says online, and on the cap puts the windows back first and leaves a note for 3 s. Four layers give the windows back: the overlay restores them before it exits; the start that started it watches its process every 0.5 s; the overlay ends within 1.5 s of no start holding the lock or the starter being gone; and a mark on disk (.mas_<i>.overlay) is found by the next status / list / info / start / stop / window. The manager's screen viewer shows the same picture and the progress while an instance boots. Refs ModAVD/ModAVD#259
…erlay disabled, helper-window tests Refs ModAVD/ModAVD#259
…ate bar, 100 ms looks The cover follows the layout of the final artwork: a thin coral bar under the character (about 60 % of its width), the percentage at its right, the step under it, placed from the middle of the window and scaled with min(height / 720, width / 810) so wide, 4:3 and portrait windows keep it. The bar is the setup's own percentage; before the setup reports one (launch, Android booting, no record yet) it is indeterminate and the number reads "…". The overlay looks every 100 ms (the windows are back about 0.15 s after the setup is recorded as done). The manager's viewer shows the same bar, number and step. Refs ModAVD/ModAVD#259
…ames, rig.json; not wired in yet) Refs ModAVD/ModAVD#259
Windows the overlay disables are state of another process, so everything around them is made to fail safe. - The windows are named in the overlay's mark (round, overlay, qemu, and per window the handle, owning process, qemu creation time and class) before they are disabled; when the mark cannot be written nothing is disabled. Handles are checked before every touch and dropped when they are another window now. Marks are read, changed and deleted under a lock and only by their own round; an enable that fails on a window that is still there keeps its entry. - All EnableWindow calls run on a worker (windowKeeper) with a 2 s deadline; the cover's thread never waits for them, and lifecycle commands recover in the background with a 1 s budget. The first disable waits for the first look at the instance, and a latched end request stops every further disable. - The cover has no owner (an owner ties its input queue to the emulator window's thread); it follows the window with SetWindowPos on itself. At the cap or when ready the covers become mouse-through at once (WS_EX_TRANSPARENT). - A close of a cover and the end of the session take the same restore path as Quit; Quit is a latch the loop and the timer look at, not only a message. - Round token per start attempt, written into the setup marker / record before the overlay starts; the overlay and status only believe a setup record of that round. The start holds a handle to the overlay and the overlay to the start (no PID polling); the start confirms the overlay gave the windows back before it returns. - The boot watch (started with the overlay) gives back the windows of an overlay that is gone within about a second. - The overlay's poller no longer waits for adb. A take-over with real setup work on a window boot gets the cover too. A done record that cannot be written is read as done at once. Refs ModAVD/ModAVD#259
…ootwatch It ends by itself when its instance is online or its qemu or start is gone, and gives the emulator's windows back before it does; its argv (exe, __bootoverlay, root, index, starter pid, starter creation time, round token) is checked like the watch's, and a different root, a missing or odd round token or an extra argument never grants a wait. Refs ModAVD/ModAVD#259
…e a window is disabled) - Nothing is disabled unless the overlay's own process and creation time, the qemu's (published whole as one value), this round (its marker or record is there; a round nobody tracks ends within 2 s without disabling anything) and the boot watch of exactly this qemu (its info names the qemu and a live process, and it holds the watch lock; waited for up to 3 s, then given up on for this run) are known. The mark that is already on disk is read under the lock: an unreadable one is not "none" (nothing is disabled), and what an earlier overlay could not give back is carried into the new mark, given back at once and never overwritten. - The window is checked again on the goroutine that makes the EnableWindow call, right before it. - A start that cannot publish its round (the setup marker cannot be written) starts no overlay. - The cap also counts from the overlay's own start (DefaultBootTimeout + bootSetupCap), whatever adb says; after Release nothing is disabled again; a cover that cannot be made mouse-through is hidden for good. - The boot watch only looks at marks of its own qemu; a recovery that finds the same windows still not answering does not rewrite the mark or warn again. - Covers: one SetWindowPos does position, size, z-order and visibility without activating anything; the cover is topmost exactly when its emulator window is, and under a third party's topmost window it goes to the top of the non-topmost ones instead of over it. Refs ModAVD/ModAVD#259
…ay so when the qemu's identity is not whole - The keeper remembered "the boot watch is running" for the rest of the run. When the qemu the overlay covers is replaced (a takeover whose boot exits and is started again), the overlay would have gone on disabling the new qemu's windows before the new qemu's boot watch was up. The guard is now remembered together with the qemu it was found for (PID and creation time); another qemu starts the wait (and the give-up time) afresh. - A qemu whose creation time cannot be read already disabled nothing; it now says so once in the log, like an overlay that cannot read its own identity. Refs ModAVD/ModAVD#259
The exported parts, screen states, eruption frames and sprites were 8-bit RGBA PNGs of 3.26 MB. They are paletted PNGs with alpha now (octree, 256 colours, no dithering): 394 KB in all, the package's artwork limit being 1 MB. The error against the originals is about 3 of 255 per channel (premultiplied RMS), and the rendered frames look the same. Refs ModAVD/ModAVD#259
…e eruption when ready) on the window and in the page - bootscreen/v3.go reads art/rig.json and draws the 15 parts in z order, each moved a little by its own sine (and its group's: the head), the screen filling in with the progress (the two nearest screen states cross-faded), and, when the instance is ready, the 15 eruption key frames, the wind on the five hair parts, seven particles outside the screen, then the fade (1.66 s to 2.21 s). The parts are scaled once for a frame size and only moved by bilinear sampling afterwards; the bitmap is made again only every 80 ms (33 ms in the eruption) or when the progress moves by 1 %. The avatar placeholder is gone. The bar, the percentage and the step line stay the code's own (layers.json "progressUi"). - The overlay no longer ends the moment the instance is ready: it gives the windows back and lets the mouse through at once, then shows the eruption and "Ready" for 2.3 s, fading the covers by their window opacity (win.Overlay.SetAlpha), and ends. - The manager's screen viewer draws the same picture on a canvas from the same files, which the page serves at assets/boot/ (it keeps the bar and the step but has no eruption: the live screen replaces it when the instance is ready). Refs ModAVD/ModAVD#259
Mutating each guard of the hardening (identity known before a window is disabled, the old mark carried and never overwritten, the window checked right before EnableWindow, no overlay for a round that could not be published, the cap counted from the overlay's own start, nothing disabled after Release, the boot watch of exactly this qemu, the cover following the emulator window's z-order) showed three that no test noticed; they have one now: - the boot watch only gives back the marks of its own qemu (process and creation time), not another boot's of the same instance; - Release in the middle of a step stops the windows that are not disabled yet from being disabled; - the keeper waits for the boot watch of a replaced qemu from the start: the time spent on the first one does not count against it, and neither does having given up on it. An unreadable mark that is not a file (a directory) is covered by the failed write that follows it; that guard alone cannot be told apart by a test. Refs ModAVD/ModAVD#259
…rned The overlay's --watch process is the start command, and start returns right after it lets the windows go, so overlayMachine.Next ended the eruption and fade with watch-gone (0.2 to 1.0 s after the release) before they were played. Once the instance is ready (doneAt set) the windows are already back and the cover is only a picture: the starting process and the start lock no longer end it. Only the show's own length (capped by overlayDoneCap, 5 s) and the qemu going away do. Before ready nothing changes: no starter or no start lock still ends it at once. Refs ModAVD/ModAVD#259
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 28, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 28, 2026
qiyinxi
added a commit
to qiyinxi/ModAVDManager
that referenced
this pull request
Nov 28, 2026
冲突:internal/emu/bootwatch.go 两边各加了一个开机守护的后台循环(脚本专用 server、开机画面标记的恢复),都保留,退出时两个都等;internal/emu/portplan_test.go 两边各加了假 adb 的环境变量,都保留。 Refs ModAVD/ModAVD#291 Refs ModAVD/ModAVD#292
This was referenced Nov 28, 2026
This was referenced Nov 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么
Refs ModAVD/ModAVD#259
开机设置做完才算在线(13b)
status、MCP 和管理器界面里的「运行中」(online),改成安卓开机完成、并且这次开机的开机后设置也做完以后才报。设置期间仍报starting,另带当前步骤和百分比。starting:安卓开机完成后最多再等 60 秒,到点照报online,日志写明哪一步没做完。模拟器不是 modavd 起的、上一次start中途没了、客体自己重启,这几种情况都有单测。status的取值没有新增,命令行start返回的时刻不变。带窗口开机时盖一层开机画面(13c,只做 Windows)
__bootoverlay,在模拟器窗口上盖一层开机画面:角色抱着的屏幕里的画随进度显出来,下面是进度条、百分比和当前步骤(中英跟管理器语言走)。start --window也有遮罩;无头开机不起遮罩。管理器网页里看实例画面那页,开机中显示同一张画面。窗口一定会还回来
__bootwatch在跑。缺一样就只挡鼠标,不禁用窗口。start被取消或失败、管理器退出时,由__bootwatch恢复;stop也会恢复。怎么测的
go vet在 Windows 上通过,darwin、linux 能编过。internal/win的窗口测试要单独跑:和别的包并行时,桌面上别的窗口会盖住测试窗口。online、遮罩放手、start返回,三个时刻相差不到 0.6 秒。从安卓开机完成到start返回 5.4 秒,和改之前的 5.0–6.7 秒一样。modavd window藏起和显示窗口时,遮罩跟着藏、跟着出来,位置一致。start返回后照样播完(2.2–2.9 秒)。--launch打开明日方舟能到标题页;每次都正常关机。PrintWindow和屏幕截图截出来是灰的。改之前的版本在同样条件下也一样灰,是这两种取法截不到 GPU 显示子窗口,不是这次改动造成的。已知限制
--timeout。超时给得更长、开机又慢时,遮罩会先放手。confirm分不清「没禁用」「只显示」「已退出」三种情况。