Convert LazyServiceRegistrar usage to singleton

am: caed24ba9b

Change-Id: Id1a200b248b30209e8481a617bdfccefc5080134
This commit is contained in:
Peter Kalauskas
2019-08-20 12:14:42 -07:00
committed by android-build-merger
3 changed files with 5 additions and 5 deletions

View File

@@ -49,8 +49,8 @@ int main()
status_t status;
if (kLazyService) {
auto serviceRegistrar = std::make_shared<::android::hardware::LazyServiceRegistrar>();
status = serviceRegistrar->registerService(provider, "legacy/0");
auto serviceRegistrar = ::android::hardware::LazyServiceRegistrar::getInstance();
status = serviceRegistrar.registerService(provider, "legacy/0");
} else {
status = provider->registerAsService("legacy/0");
}

View File

@@ -46,8 +46,8 @@ int main() {
android::sp<IMediaCasService> service = new MediaCasService();
android::status_t status;
if (kLazyService) {
auto serviceRegistrar = std::make_shared<LazyServiceRegistrar>();
status = serviceRegistrar->registerService(service);
auto serviceRegistrar = LazyServiceRegistrar::getInstance();
status = serviceRegistrar.registerService(service);
} else {
status = service->registerAsService();
}

View File

@@ -58,7 +58,7 @@ int main(int /*argc*/, char** argv) {
std::make_shared<WifiIfaceUtil>(iface_tool),
std::make_shared<WifiFeatureFlags>());
if (kLazyService) {
LazyServiceRegistrar registrar;
auto registrar = LazyServiceRegistrar::getInstance();
CHECK_EQ(registrar.registerService(service), android::NO_ERROR)
<< "Failed to register wifi HAL";
} else {