Revamp exceptions

Various changes, based on the comments on aosp/2192077 and the API
guidelines:
- Always rethrow RemoteException as a runtime exception.
- Map the various other exceptions that VirtualizationService can
  return to VirtualMachineException for consistency - except for
  SecurityException (missing permissions) which will still be directly
  thrown.
- Document the exceptions that can be thrown and when for each API
  function.
- Always create the console & log pipes on demand, mostly so I don't
  have to document exactly when they might be null.
- Use an exception rather than an Optional for getCid().
- Check for null return from nativeConnectToVsockServer() and throw.

Bug: 243512115
Test: atest MicrodroidTests MicrodroidHostTests
Change-Id: Ib5cb421bc9137db4d9dddada71f0098212b7d0da
3 files changed
tree: 14df514d45daea9da9503cd68dd0b88b044b3d64
  1. apex/
  2. apkdmverity/
  3. authfs/
  4. avmd/
  5. compos/
  6. demo/
  7. docs/
  8. javalib/
  9. launcher/
  10. libs/
  11. microdroid/
  12. microdroid_manager/
  13. pvmfw/
  14. rialto/
  15. tests/
  16. virtualizationservice/
  17. vm/
  18. vmbase/
  19. vmclient/
  20. zipfuse/
  21. .clang-format
  22. .gitignore
  23. Android.bp
  24. OWNERS
  25. PREUPLOAD.cfg
  26. README.md
  27. TEST_MAPPING
README.md

Virtualization

This repository contains userspace services related to running virtual machines on Android, especially protected virtual machines. See the getting started documentation and Microdroid README for more information.