apexd: skip staging package if it is already in /data/apex/active

This should prevent following (very unlikely) situation:
1. New staged session is created containing following apexes:
  foo@1.apex, bar@2.apex.
2. foo@1.apex is already activated (i.e. /data/apex/active/foo@1.apex exists).
3. stagePackages() fails to link bar@2.apex.
4. Deleter removes /data/apex/active/foo@1.apex
5. Apexd ends up deactivating a package it should've kept.

Test: apexservice_test
Change-Id: Id859d1bbc74664ca3d36bc2a72e829bc2ffff701
1 file changed
tree: a35c78547093d825cf702ad1aa7857a043083910
  1. apexd/
  2. apexer/
  3. proto/
  4. tests/
  5. OWNERS
  6. PREUPLOAD.cfg
  7. TEST_MAPPING