Guest OS serial console

VirtualMachine library changes:
Add a new debug config "connectVmConsole".
If it is true then AVF would create a pty (pseudoterminal) on host and
connect it to the VM serial console.
If "vmOutputCaptured" is also true, then a worker thread would be
submitted to the background and tee the VM console output to both
VirtualMachine#getConsoleOutput() and the host pty.

VirtualMachine#getHostConsoleName() to get the name of the peer end of
the pty (aka. ptsname) which usually looks like `/dev/pts/<num>`.
The number of the pts node is not fixed as it is dynamically allocated
by the pty driver.

You can then connect to the serial console through adb:
```
$ # Get the readonly logs only
$ adb shell cat /dev/pts/0
$ # Connect to console with microcom; exit with `ctrl-]` then `q`
$ adb shell -t microcom /dev/pts/0
$ # Or with netcat
$ adb shell -t 'stty raw -echo && netcat -f /dev/pts/0'
```
Keep in mind that special characters like ctrl-c and ctrl-z are _not_
intepreted, so you would not be able to interrupt the host netcat
command by typing ctrl-c. Pressing ctrl-c would send the ctrl-c keycode
to the other end of the serial console, and cause an interrupt in the
guest VM console.

If you want to be able to interrupt and stop the host netcat command,
pass the `isig` terminal option:
```
adb shell -t 'stty raw isig -echo && netcat -f /dev/pts/0'
```

Vmlauncher APP changes:
Don't flood the host logcat with guest VM console logs.
Instead direct it to a file:
/data/user/0/com.android.virtualization.vmlauncher/files/console.log
User can also connect to the host pts to connect to the VM console.

BYPASS_INCLUSIVE_LANGUAGE_REASON=It is well known that "man" stands for
the "[man]ual" command in the unix world.

Bug: 335362012
Test: Start a vm and then `adb shell -t microcom /dev/pts/0`
Change-Id: I9179510b237b8a19b8da7c527f3f42846a127dd3
4 files changed
tree: 4a2d6db68e14ee5e2bd29c83effb78e9eb860fa9
  1. apex/
  2. apkdmverity/
  3. authfs/
  4. compos/
  5. demo/
  6. demo_native/
  7. docs/
  8. encryptedstore/
  9. flags/
  10. java/
  11. launcher/
  12. libs/
  13. microdroid/
  14. microdroid_manager/
  15. pvmfw/
  16. rialto/
  17. service_vm/
  18. tests/
  19. virtualizationmanager/
  20. virtualizationservice/
  21. vm/
  22. vm_payload/
  23. vmbase/
  24. vmclient/
  25. vmlauncher_app/
  26. zipfuse/
  27. .clang-format
  28. .gitignore
  29. Android.bp
  30. avf_flags.aconfig
  31. OWNERS
  32. PREUPLOAD.cfg
  33. README.md
  34. rustfmt.toml
  35. TEST_MAPPING
README.md

Android Virtualization Framework (AVF)

Android Virtualization Framework (AVF) provides secure and private execution environments for executing code. AVF is ideal for security-oriented use cases that require stronger isolation assurances over those offered by Android’s app sandbox.

Visit our public doc site to learn more about what AVF is, what it is for, and how it is structured. This repository contains source code for userspace components of AVF.

If you want a quick start, see the getting started guideline and follow the steps there.

For in-depth explanations about individual topics and components, visit the following links.

AVF components:

AVF APIs:

How-Tos: