Merge "Activate apexes in /system_ext/apex, /vendor/apex" am: 5f28d3c732
Change-Id: Ic3c9c22ac0167c445cac52fd05a1fe2d52d7b9cd
diff --git a/cmds/installd/otapreopt_chroot.cpp b/cmds/installd/otapreopt_chroot.cpp
index 7c989f6..6459805 100644
--- a/cmds/installd/otapreopt_chroot.cpp
+++ b/cmds/installd/otapreopt_chroot.cpp
@@ -61,11 +61,15 @@
static std::vector<apex::ApexFile> ActivateApexPackages() {
// The logic here is (partially) copied and adapted from
- // system/apex/apexd/apexd_main.cpp.
+ // system/apex/apexd/apexd.cpp.
//
- // Only scan the APEX directory under /system (within the chroot dir).
- // Cast call to void to suppress warn_unused_result.
- static_cast<void>(apex::scanPackagesDirAndActivate(apex::kApexPackageSystemDir));
+ // Only scan the APEX directory under /system, /system_ext and /vendor (within the chroot dir).
+ std::vector<const char*> apex_dirs{apex::kApexPackageSystemDir, apex::kApexPackageSystemExtDir,
+ apex::kApexPackageVendorDir};
+ for (const auto& dir : apex_dirs) {
+ // Cast call to void to suppress warn_unused_result.
+ static_cast<void>(apex::scanPackagesDirAndActivate(dir));
+ }
return apex::getActivePackages();
}