apexd: don't mount a package if its higher version is already mounted

A very basic greedy implementation that skips mounting an apex if there
is already a higher version mounted.
As a side effect, this change also enforces that we will never downgrade
an apex below the version that is in /system, which IIRC is a desired
behaviour.

Note that in case when apex in /system has higher version that the one
in /data, apexd will still mount that package twice. Given that having
an apex in /data that has lower version than /system one should be a
very race scenario, this simple solution should work just fine.

Test: put higher version of test apex into /data.
      Verified /system version wasn't mounted.
Bug: 119911415
Fixes: 119911415
Change-Id: If451e0f0b17a06d0b5a41e1bb95cee737600d6b8
1 file changed
tree: f82452a582b769f9ddc414533ff830d69f16fbbf
  1. apexd/
  2. apexer/
  3. proto/
  4. shim/
  5. tests/
  6. OWNERS
  7. PREUPLOAD.cfg