Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d13f08be authored by Steven Moreland's avatar Steven Moreland
Browse files

servicemanager: preload vintf manifest

Doing this asynchronously since it was delaying first client by ~6ms on
crosshatch and other devices.

Bug: 144282062
Test: on walleye, StartVibratorService ~9ms -> ~4ms.
Change-Id: I6cc65e74922b32c2e7135f583fa892fa26f85e2b
parent b5667012
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -68,7 +68,15 @@ static bool meetsDeclarationRequirements(const sp<IBinder>& binder, const std::s
}
#endif  // !VENDORSERVICEMANAGER

ServiceManager::ServiceManager(std::unique_ptr<Access>&& access) : mAccess(std::move(access)) {}
ServiceManager::ServiceManager(std::unique_ptr<Access>&& access) : mAccess(std::move(access)) {
#ifndef VENDORSERVICEMANAGER
    // can process these at any times, don't want to delay first VINTF client
    std::thread([] {
        vintf::VintfObject::GetDeviceHalManifest();
        vintf::VintfObject::GetFrameworkHalManifest();
    }).detach();
#endif  // !VENDORSERVICEMANAGER
}
ServiceManager::~ServiceManager() {
    // this should only happen in tests