tree: 9906457080cb1fa9655aedd954b6983afb94ea72 [path history] [tgz]
  1. accessor/
  2. accessor_vm/
  3. aidl/
  4. apex/
  5. test/
  6. README.md
tests/vm_accessor/README.md

Demo for serving a service in a VM

You can implement a service in a VM, and let client in the Android can use it as if it's in the Android. To do so, use libbinder's IAccessor.

IAccessor allows AIDL service in a VM to be accessed via servicemanager. To do so, VM owners should also provide IAccessor through libbinder's service manager APIs. servicemanager will connect to the IAccessor and get the binder of the service in a VM with it.

com.android.virt.accessor_demo apex contains the minimum setup for IAccessor as follows:

  • accessor_demo: Sample implementation using IAccessor, which is expected to launch VM and returns the Vsock connection of service in the VM.
  • AccessorVmApp: Sample app that conatins VM payload. Provides the actual implementation of service in a VM.

Build

You need to do envsetup.sh

m com.android.virt.accessor_demo

Install (requires userdebug build)

For very first install,

adb remount -R || adb wait-for-device  # Remount to push apex to /system_ext
adb root && adb remount                # Ensure it's rebooted.
adb push $ANDROID_PRODUCT_OUT/system_ext/apex/com.android.virt.accessor_demo.apex /system_ext/apex
adb reboot && adb wait-for-device      # Ensure that newly pushed apex at /system_ext is installed

Once it's installed, you can simply use adb install for update.

adb install $ANDROID_PRODUCT_OUT/system_ext/com.android.virt.accessor_demo.apex
adb reboot