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 apexd_host_tests
Test: atest --test-mapping system/apex/apexd
Bug: 137086602
Change-Id: Ic546f6869984c2df7e9deaf9d7b87d2195406f23
(cherry picked from commit ebf334c61425bd72b4b0973885abd4675c3f1486)
8 files changed