summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2019-11-18 14:23:09 -0800
committerSteven Moreland <smoreland@google.com>2019-11-18 14:23:09 -0800
commitd13f08beacc0ccf9cfba83d8c68900816bfdb349 (patch)
tree97ef302e60485943097a12f9e386ca16b5352092
parentb5667012c116931ca0c4859f2e1e2a5da1fa30f0 (diff)
downloadnative-d13f08beacc0ccf9cfba83d8c68900816bfdb349.tar.gz
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
-rw-r--r--cmds/servicemanager/ServiceManager.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmds/servicemanager/ServiceManager.cpp b/cmds/servicemanager/ServiceManager.cpp
index 861401c979..2d2af3c716 100644
--- a/cmds/servicemanager/ServiceManager.cpp
+++ b/cmds/servicemanager/ServiceManager.cpp
@@ -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