Connect settings, VM starts, disk operations and serial configuration to daemon-owned state while retaining existing names and categories. Hide normal shared-storage status rows.
Coordinate hugepage writes and module lifecycle with the daemon. Show migration only for legacy settings and operation lookup only for an unresolved request.
Add host preferences, disk defaults, hugepage, USB ACM and WebUI clients with receipt tracking, legacy migration and client contracts. Initialize shared clients and add localized messages.
Replace duplicated creation defaults and rescue scripts with shared sources and use the daemon Vulkan probe from JNI. Update the existing regression tests.
Add API contracts, build and validation tools, embedded assets and required license resources. Record daemon and WebUI revisions and shared default data.
Settings import saved disks with the legacy DataStore write, which the
ownership gate refuses once the daemon owns configuration, so an import
stopped at the disk step. DiskStore.importPersisted replaces rows by id and
appends new ones in one conditional disk_config upload, keeping untouched
rows and root extensions exact; a path already registered under another id
is refused. loadStore now dispatches to the three per-store importers.
The pre-start compressed/snapshot disk convert passed only a path, so even a
registered disk was rewritten by qemu-img under su, outside the daemon's
leases and registry. It now resolves the registered disk and runs a native
convert by id; an unregistered path is reported instead (it cannot start in
owner mode anyway). DiskOperationActivity refuses path-only tasks other than
create, and optimizeForResultIntent is removed.
Verified: assembleDebug and assembleRelease pass. Not yet exercised on a
device.
0862ead broke assembleRelease: lintVitalRelease reports BlockedPrivateApi
on TRANSACTION_broadcastIntentWithFeature. The access runs only after
HiddenApiBypass exempts IActivityManager, so suppress the check on capture().
Verified: assembleDebug and assembleRelease pass.
Advances daemon to accept Agent temporary VMs (vm_create "temporary": true
and their vm_delete) in owner mode; the app already marks them. Adds
run_agent_temporary_vm_probe.py: isolated owner daemon, Agent-shaped crosvm
VM boots to the rescue shell, runs a command and is deleted without being
persisted. Passed on warsaw (boot 7.8 s, 9 checks, cleanup complete).
The daemon's display binder broadcast used a parcel layout verified only
for warsaw, so on other firmware the native display waited forever.
BroadcastProfile reproduces PlatformProfileTest in the app (Intent layout,
extras slot, Bundle trailer, broadcastIntentWithFeature code, signature
check) and display_attach sends it. HiddenApiBypass exempts only
Landroid/app/IActivityManager.
Verified on OnePlus OP6546L1 (API 36): captured transaction=23
extras_offset=124 trailer=00000000; daemon used the client profile, VM
started and the native display connected at 1920x1080.
On some ROMs (OnePlus OP6546L1, Android 16) the daemon's main thread is
renamed "Binder:droidvmd" once it joins the Binder thread pool, so the
comm check rejected the live daemon: the app reported the service as
stopped and every start failed on the held runtime lock. readPid now
matches the basename of /proc/<pid>/cmdline argv[0].
"Adjust huge pages on start" (default on) in the VM settings. Off, the
daemon leaves the huge-page reserve target alone and does not wait for it;
the start guard then warns when the reserve is short instead of assuming
the daemon will size it. Advances the daemon and extends the runtime probe.
Verified: app compiles; runtime probe --autostart PASS 24 checks, full
lifecycle PASS 39.
AGP strips jniLibs only, so droidvm, daemon and droidvmd shipped in
assets/bin kept their debug info (droidvmd 71 MB debug / 68 MB release).
CopyNativeBinAssets now writes them through the NDK llvm-strip
--strip-unneeded; the unstripped build stays under
intermediates/native_binaries for symbolization. arm64 droidvmd is now
8.8 MB debug / 4.0 MB release. verify_native_assets compares the APK with
the stripped copies.
Verified: Debug and Release build; verify_native_assets PASS;
run_configuration_owner_probe with the stripped droidvmd PASS (8 checks).
Clearing app data (or reinstalling) deletes run/ under a running root
droidvmd. The new lock file is a different inode, so the next launch
started a second daemon beside it. Before every start, kill droidvmd
processes whose open lock is "run/droidvmd.lock (deleted)" with SIGKILL
(their teardown would act on names the new daemon may own), then the
pbridge/netbox/bridgedhcp/gvswitch helpers from the app's bin left
orphaned. A daemon on the live directory is never touched.
Verified on device: the stale daemon and its orphaned netbox were killed;
the live daemon, its helpers and br-wifi kept running.
Ownership was read from a preference or a non-empty gate file, so a fresh
install started droidvmd in legacy mode, where coordinated network deletion
and other revisioned APIs are absent ("Coordinated network deletion API is
unavailable"). With the Java daemon gone there is no other writer: always
pass --configuration-owner and drop the preview switch.
Restart now stops every droidvmd (a reinstall leaves the previous one
running on a deleted data directory): SIGINT, SIGKILL after 30 s, then
kills pbridge/netbox/bridgedhcp/gvswitch helpers from the app's bin left
without a daemon. Networks running before the restart are started again,
not only auto-up ones.
The export screen re-sent its VM through vm_exists + vm_modify/vm_create
before vm_export. A daemon that owns VM configuration refuses those legacy
writes ("failed to modify VM") and already holds the saved VM, so export
now goes straight to vm_export when the revisioned VM configuration API is
offered; the legacy push stays for older daemons.
Verified: app Debug compiles. Reported by on-device export under native
configuration ownership.
DiskOperationActivity sends the settings' qemu-img core list as "cpus";
the daemon binds the tool as taskset did on the legacy path. Advances the
daemon to API 26 and updates the disk-config probe expectations.
Verified: app Debug and migration-tests build; --vm-disks TCP probe PASS
(42 checks).
DiskOperationClient exposes the task's basis-point progress and an
await overload with a progress callback; DiskOperationActivity shows the
percentage while a native operation runs. Advances the daemon to the
FUSE install fallback and qemu-img progress reporting.
Verified: app Debug and migration-tests build; --vm-disks TCP probe with
Java DiskOperationTcpTest PASS (38 checks).
droidvmd is now the only service: DaemonHelper always launches it (with
--configuration-owner once ownership is claimed), and the "native service"
settings switch is gone. Removed the cn.classfun.droidvm.daemon
implementation (132 files), its JNI adapter (UnixHelper, NativeProcess,
libunixhelper), the unit tests of removed classes and the migration-tests
NativeProcess bridge. UsbRules, UsbHostDevice, UplinkResolver, UsbAcmPool
and RequestException stay because the UI still uses them. Oracle probes
now take --oracle-apk (default: the archived pre-removal debug APK).
Verified: app Debug/Release, androidTest and migration-tests APKs build;
no daemon classes or libunixhelper in the APK; unit tests 466 run, the 12
failures are pre-existing (Windows ':' directory names in
UsbHostDeviceTest, AgentActionQueueTest); run_configuration_owner_probe
on device PASS 8 checks.
VmConfigClient.start refused snapshots read right after a daemon restart (always durability-uncertain), so no VM could start until some configuration was saved. The daemon now syncs such a snapshot before launching; the client keeps its single submission and revision check.
Extracting bin/droidvmd while the native daemon runs opened the busy executable for writing (ETXTBSY) because the app cannot unlink entries in the root-owned bin directory, so upgrades silently kept the old daemon binary and never recorded its hash. Assets are now written completely to the app cache and swapped into place (rename, else root mv -f), so the running process keeps its old inode.
Verified on device: upgrading the installed app while droidvmd --configuration-owner ran replaced bin/droidvmd, recorded its hash, and the app restarted the daemon with ownership and the native br-wifi network intact.
Add a settings switch (default off) that, after an explicit irreversible confirmation, makes DaemonHelper start droidvmd with --configuration-owner. Once the persistent ownership gate is non-empty the flag and the native daemon are always used, since a legacy-mode or Java daemon would be refused, and the switch cannot be turned back off. VmConfigOwnership.claimed reads the gate without creating it.
Verified: Debug/Release compile and assembleDebug; the packaged arm64 droidvmd from that APK passes run_configuration_owner_probe (8 checks, cleanup complete). The settings flow and an owned production data directory were not exercised on device; no production APK was installed.
Legacy store saves are refused once the daemon owns configuration. Downloaded disks now register through DiskStore.register (native session or gated legacy write) and report failures instead of dropping them. BackingChainLinker edits the registry through one revisioned native session when the daemon owns disks and leaves header rewrites to the daemon, which resolves relative names and pins parents by lease. VM deletion cleans up its disks with leased daemon deletes, leaf first, re-reading references each round; unregistered files keep the previous client-side removal.
Verified: Debug/Release compile; BackingChainLinkerTest passes; the full app unit suite shows the same 30 pre-existing USB/agent failures with and without this change. UI flows not exercised on device.
Add run_configuration_owner_probe for droidvmd --configuration-owner in an isolated data directory (passed with cleanup) and remove the isolated legacy ownership gate file in run_vm_inventory_probe cleanup (42 checks passed).
DiskOperationActivity maps convert with a different output to the daemon's relocating convert instead of refusing it. Debug/Release compile; daemon side verified on device (pkg 44 groups, real qemu-img, UBSan, --vm-disks TCP).
When the daemon offers native disk operations, DiskCreateActivity no longer pre-registers a row: DiskOperationActivity sends a path-mode create (registered backing only) and the daemon creates and registers the image. DiskOverlayCreateDialog submits an overlay create whose follow/read-only choice moves stopped VMs' slots in the daemon transaction, and overlay reset uses the daemon's leased reset instead of client-side qemu-img and rename. Planning reads use the native-aware registry snapshot. Legacy mode keeps the existing flows.
Verified: Debug/Release Java and migration test APK compile; device --vm-disks TCP probe (including the Java disk operation test) passed with cleanup. These UI flows were not exercised interactively on device.
Add DiskOperationClient for the API 25 disk operation tasks: capability check, single submission pinned to a disk registry revision, SubmitUnknown for lost or internal admission replies (never resubmitted), polling, cooperative cancel and recovery. When the daemon offers native operations, DiskOperationActivity no longer runs su shell commands or client-side registry follow-ups for registered disks: resize, convert/optimize in place, flatten, commit and clone map to daemon requests, unsupported shapes (converting into another file) fail instead of falling back, and registry/capability reads move off the main thread. The joint delete dialog enables image deletion through the daemon's leased delete operation pinned to the confirmed revision.
Verified: Debug/Release Java compile; device --vm-disks TCP probe with the new DiskOperationTcpTest instrumentation (create, stale revision, resize, lost start reply reported unknown without resubmission, delete with files, no leftovers) passed with cleanup. Activity/dialog UI flows were not exercised on device; production daemon does not advertise disk operations yet.
Native resize/convert/flatten tasks with registry reservations, file leases and journaled replacement; device pkg contract 40 groups, real qemu-img suite and UBSan pass.