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.

Bug: 128854225
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
Merged-In: I3afc67d0a89bd8fe03c7db00b8f98aecd1357a95
(cherry picked from commit 65a2508eee61df07aaedf1914bc653fe577e7759)
5 files changed
tree: 903f7ce0f727b8245e20cfc3215508d7e1575244
  1. apexd/
  2. apexer/
  3. proto/
  4. shim/
  5. tests/
  6. CleanSpec.mk
  7. OWNERS
  8. PREUPLOAD.cfg