apexd: Refactor code around mounting/unmounting apexes

* mountFlattened & mountNonFlattened return StatusOr<MountedApexData>;
* MountPackage split into:
  * MountPackageImpl - does all the mounting logic;
  * MountPackage - calls impl and adds package to the database;
* UnmountPackage split into:
  * Unmount - does all unmounting related logic;
  * UnmountPackage - removes data from the database and calls first;

As part of this, when UnmountPackage is called, apexd will be
immediately remove apex from the database.

This CL prepares introduction of temp mounting which is required for
validating apex images when staging new session.

Test: apexservice_test, apex_database_test, apex_e2e_tests
Bug: 128625955
Change-Id: Id5e75f082febdfbb48bc58cf6f1e0b2087dc32bb
1 file changed
tree: 4dbf2112346ca0d32a481514de48427fe96e4542
  1. apexd/
  2. apexer/
  3. proto/
  4. shim/
  5. tests/
  6. OWNERS
  7. PREUPLOAD.cfg