Apexd: fix pre-allocation of loop devices

This is rework of aosp/930739 (reverted by aosp/933217).

The intent was that when estimating required number of loop devices,
we should take bootstrap apexes into account because they can be
activated in separate namespaces.

The reason why it was reverted is that it broke ARC.
Becase ARC doesn't support loop-device and there are no builtin APEXes,
preAllocateLoopDevices() should not be called.
However, with aosp/930739 preAllocateLoopDevices() got to be called.

This commit searches builtin APEXes and counts them differently.

And now it also takes /product/apex into account.

Test: atest apexservice_test
Test: put an APEX in /product/apex and see the booting log if
      it is counted for pre-allocation.
Change-Id: I3afc67d0a89bd8fe03c7db00b8f98aecd1357a95
5 files changed
tree: 01ebfcc301e697544f6c8c3a404223a2a4b89936
  1. apexd/
  2. apexer/
  3. proto/
  4. shim/
  5. tests/
  6. CleanSpec.mk
  7. OWNERS
  8. PREUPLOAD.cfg