android_packages_modules_Vi.../demo
Alan Stokes 20696d9790 Move delete to VirtualMachineManager
This allows us to make sure we can delete a VM even if it is corrupted
(e.g. missing or malformed config file). Also delete all files in the
VM directory, even ones we don't expect to be there, as otherwise the
VM name can never be reused.

For consistency, modify load() to return null iff the VM directory
doesn't exist; other missing files cause an exception to be thrown.

While I'm here, move the vm files under getDataDir (which the app
shouldn't be touching) rather than getFilesDir (where it might want to
create its own directory called "vm").

Add tests. Modify test & demo APKs to match.

Bug: 242999384
Bug: 257474585
Test: atest MicrodroidTests
Change-Id: I3525e4c7c208a9bd1a7c41d6475327038073d6e6
2022-11-07 15:40:14 +00:00
..
java/com/android/microdroid/demo Move delete to VirtualMachineManager 2022-11-07 15:40:14 +00:00
res
Android.bp
AndroidManifest.xml
README.md

README.md

Microdroid demo app

Building

UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true TARGET_BUILD_APPS=MicrodroidDemoApp m apps_only dist

Installing

adb install -t out/dist/MicrodroidDemoApp.apk
adb shell pm grant com.android.microdroid.demo android.permission.MANAGE_VIRTUAL_MACHINE

Don't run the app before granting the permission. Or you will have to uninstall the app, and then re-install it.

Running

Run the app by touching the icon on the launcher. Press the run button to start a VM. You can see console output from the VM on the screen. You can stop the VM by pressing the stop button.