Don't activate orphaned APEXes

If an OTA update removes a pre-installed APEX, apexd won't activate it's
/data counterpart.

To achieve this, scanPackagesDirAndActivate is split into two parts:
* ScanApexFiles
* ActivateApexPackages

Note that in order to minimize difference in behaviour, other logic
(e.g. activating immediately after scanning) is preserved. Although it
can be changed in the future to avoid unnecessary mounts.

Test: atest --test-mapping system/apex/apexd
Test: atest apexd_host_tests
Bug: 137086602
Change-Id: Ic546f6869984c2df7e9deaf9d7b87d2195406f23
Merged-In: Ic546f6869984c2df7e9deaf9d7b87d2195406f23
8 files changed