(feat) hugepage model; (fix) vnc fullscreen bug; (fix) start vm open vnc#34
Merged
Conversation
Expose the module's three acquire algorithms in the UI and reflect which one is running. - Buttons: v1/v2/v3 on the process-list "waiting for acquire" row and a new "Acquire huge pages" item on the main status screen (shared acquire_buttons.xml, same row style as the stat rows). Each writes acquire=1/2/3 via HugePageOps.acquire(int mode, ...). - Per-mode spinner: read acquire_mode from refill_stat (readPoolPages index 5, -1 when the module can't report it). While a run is in flight only the running mode spins (tap = stop) and the other two grey out; an unknown mode (old module) falls back to spinning all three. - Enable only on a real deficit: loaded && pool_want > 0 && avail+served < want. Disabled when not loaded, already at target, or soft-disabled (want=0). - Gentler defaults: pool-size minimum lowered to 0 (ti_min=0MiB); soft-disable writes pool_want=0; Enable/Save auto-fill uses v1 (migrate only, no zram eviction, no reboot risk). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TaHcvnHaZk8qqpKiS25Hbk
Point the prebuilts submodule at 2c31cecdedb5110e8861b8b698ba5b538725cfb7 (same DroidVM-Prebuilt-Root 4016dba, rebuilt). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TaHcvnHaZk8qqpKiS25Hbk
…as VM info Starting a VM from the list auto-opened VMConsoleActivity (UART) unconditionally (MainVMFragment.onVMStateChanged hard-coded it), while the VM-info console button (ConsoleButton.openDefaultConsole) is display-aware: native display, else VNC, else the serial console. So a VNC/native VM started from the list wrongly popped the UART console instead of its display. Extract that routing into a shared VmConsoleRouter.openDefault(); the info button and the list auto-open now both call it, so they agree. ConsoleButton's chooser open-helpers delegate to the router too (single source of truth). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TaHcvnHaZk8qqpKiS25Hbk
netd owns net.ipv4.ip_forward and net.ipv6.conf.all.forwarding globally and clears them whenever it retunes tethering, silently black-holing every forwarded guest packet. IptablesBackend enables them once at init; DefaultRouterWatcher now re-asserts them on its 5s tick for as long as a running LINUX + L3 network needs kernel forwarding. Gated on hasL3LinuxBridge() -- the same condition the routing rules use -- so with no L3 bridge netd's value is left alone rather than forcing global forwarding on the phone. Both families are covered because netd flips v4 and v6 together. Reads before writing via runQuiet so the poll stays out of logcat; only a value netd actually reset is corrected and logged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TaHcvnHaZk8qqpKiS25Hbk
Two Python checks wired into a new Checks workflow (push + PR): - check_ascii.py: fails on any non-ASCII byte in a tracked file, so a stray smart-quote, em-dash, arrow or CJK char can't slip into code, comments or config. Genuine i18n / natural-language files are exempt via scripts/ci/ascii_allow.txt (translations, privacy text, docs, ...). - check_translations.py: fails if any values-<locale>/strings.xml is missing, has extra, or has stale entries vs the translatable keys in values/strings.xml, so nothing ships half-translated. Fixes so the current tree passes: - Replace the check/cross emoji in the virtualization setup step with inline tinted vector icons (ImageSpan over ic_check/ic_close); widen showDetail() to CharSequence; add status_supported/status_unsupported colors. The mode menu already used circle icons; only a stale glyph comment remained. - Convert typographic dashes/arrows/minus-sign and stray CJK in the hugepage and Try comments to ASCII. - Add the 4 missing zh-rTW strings (vm_exit_crash, vm_exit_guest_panic, vm_exit_watchdog, vm_rebooting). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TaHcvnHaZk8qqpKiS25Hbk
BigfootACA
requested changes
Jul 6, 2026
Comment on lines
+970
to
+975
| <string name="hugepage_proc_acquire_v1">v1</string> | ||
| <string name="hugepage_proc_acquire_v2">v2</string> | ||
| <string name="hugepage_proc_acquire_v3">v3</string> | ||
| <string name="hugepage_proc_acquire_v1_desc">获取 v1(alloc_contig_pages 扫描)</string> | ||
| <string name="hugepage_proc_acquire_v2_desc">获取 v2(迁移+系统回收)</string> | ||
| <string name="hugepage_proc_acquire_v3_desc">获取 v3(迁移+逐块挤到 zram)</string> |
Member
There was a problem hiding this comment.
按钮的字符串不展示v1/v2/v3字样
改为只有一个获取按钮,按下弹出PopupMenu(使用MaterialMenu变种),三个选项alloc_contig_pages 扫描 迁移+系统回收 迁移+逐块挤到 zram
不使用全角符号
| <string name="hugepage_acquire_v3_explain">Uses folio_isolate_lru + reclaim_pages to precisely push pages into swap/zram\nthen alloc_contig_range to collect huge pages</string> | ||
| <string name="hugepage_proc_acquire_running">Acquiring huge pages…</string> | ||
| <string name="hugepage_proc_acquire_done">Acquire done</string> | ||
| <string name="hugepage_acquire_degraded">Downgraded — ran %1$s instead</string> |
| # build files, layouts, manifests and config must stay ASCII. | ||
|
|
||
| # UI strings: translation source (values/) and the translations themselves. | ||
| app/src/main/res/values*/strings.xml |
Member
There was a problem hiding this comment.
英文翻译app/src/main/res/values/strings.xml也不能有非ASCII字符
这里可以写app/src/main/res/values-*/strings.xml
Comment on lines
-626
to
-639
| private void doUnload() { | ||
| btnModuleToggle.setEnabled(false); | ||
| runOnPool(() -> { | ||
| var result = runList("rmmod", "gh_hugepage_reserve").isSuccess(); | ||
| runOnUiThread(() -> { | ||
| var msg = result ? | ||
| R.string.hugepage_unloaded : | ||
| R.string.hugepage_unload_failed; | ||
| Toast.makeText(this, msg, LENGTH_SHORT).show(); | ||
| refreshStatus(true); | ||
| }); | ||
| }); | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
unload按钮需要保留
可以放到菜单menu_hugepage_activity.xml内
| private List<Try<LoadImpl, Void>> loadLadder(long pages) { | ||
| var log = new ArrayList<Try<LoadImpl, Void>>(); | ||
| var w = "pool_want=\"" + pages + "\""; | ||
| var t = "pool_target=\"" + pages + "\""; |
Member
There was a problem hiding this comment.
使用fmt函数格式化字符串
不要使用+拼接字符串
涉及行: 368, 431, 432, 441, 514, 515, 622
Comment on lines
+452
to
+453
| ? run("insmod \"%s\"", KO_PATH) | ||
| : run("insmod \"%s\" %s", KO_PATH, arg); |
| : R.string.hugepage_acquire_v1_explain; | ||
| // Title = "Acquire huge pages" + the mode badge, e.g. "Acquire huge pages v1". | ||
| String title = ctx.getString(R.string.hugepage_acquire_pages_title) | ||
| + " " + ctx.getString(modeLabel); |
| * warning below, and only when netd actually reset the value. | ||
| */ | ||
| private void ensureSysctlOne(@NonNull String path, @NonNull String name) { | ||
| var cur = RunUtils.runQuiet("cat " + path).getOutString(); |
… shell calls, ASCII base strings Addresses BigfootACA's review comments: - Rename VmConsoleRouter -> VMConsoleRouter (VM initialism); update references. - Move the generic Try<I,V> degradation-ladder helper to lib/utils for reuse (now public; javadoc de-specialised from HugePageModel). - HugePageModel: wrap the module path in escapedString(); build strings with fmt() instead of + concatenation. - HugePageActivity: fmt() for the acquire-dialog title. - DefaultRouterWatcher: read the sysctl via shellReadFile(). - Base values/strings.xml is ASCII-only now (typographic ellipsis/em-dash -> "..." / "-"), and the non-ASCII allowlist narrows to values-*/strings.xml so the English source file is checked too. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TaHcvnHaZk8qqpKiS25Hbk
BigfootACA
approved these changes
Jul 6, 2026
… ones
Add scripts/ci/check_string_concat.py (wired into the Checks workflow): a
Java-literal-aware scanner that fails when a bare + joins a string literal with a
runtime expression ("x=" + v), which reads better as fmt("x=%s", v). It masks
comments and string/char literals first, so + inside a literal ("wlan+", "%s+",
"\s+") and literal+literal constants are not flagged; a line can opt out with a
trailing // concat-ok comment.
A glance-obvious accumulator append stays as-is: a += statement with at most ONE
+ (s += "x" + y) reads clearly and is exempt; a += chaining two or more +
(s += "a" + b + "c") loses the exemption and is flagged. Only concatenation that
doesn't read at a glance is pushed to fmt(). The + count is scoped per statement
(to the next ; { }).
Convert the pre-existing complex concatenations across the codebase to fmt()
(mostly Log calls); route filesystem-path joins through pathJoin(). Simple
single-+ += appends are left as +=. StringUtils.pathJoin's own body keeps its +
with a // concat-ok note -- it is the canonical joiner and fmt() there would be
a hot-path cost.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TaHcvnHaZk8qqpKiS25Hbk
The gh_hugepage_reserve module now exports acquire_stop_reason in refill_stat (why the last user-triggered acquire stopped). Thread it through Snapshot as a pass-through display string (like state/totalServed) and append it to the acquire-done Toast, so the user sees the reason in the bubble instead of having to read dmesg. Kernel free text; appended raw (localization is a follow-up). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
改動*n