mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge "Convert LazyServiceRegistrar usage to singleton" am: f71728f04b am: 0c7812c7f5
am: 4ddbdbca8b
Change-Id: I9f3b2f6d1e035158244d09eb3b7f669c510259a1
This commit is contained in:
@@ -46,8 +46,8 @@ int main() {
|
|||||||
android::sp<IMediaCasService> service = new MediaCasService();
|
android::sp<IMediaCasService> service = new MediaCasService();
|
||||||
android::status_t status;
|
android::status_t status;
|
||||||
if (kLazyService) {
|
if (kLazyService) {
|
||||||
auto serviceRegistrar = std::make_shared<LazyServiceRegistrar>();
|
auto serviceRegistrar = LazyServiceRegistrar::getInstance();
|
||||||
status = serviceRegistrar->registerService(service);
|
status = serviceRegistrar.registerService(service);
|
||||||
} else {
|
} else {
|
||||||
status = service->registerAsService();
|
status = service->registerAsService();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ int main() {
|
|||||||
configureRpcThreadpool(1, true);
|
configureRpcThreadpool(1, true);
|
||||||
|
|
||||||
sp<IStorage> service = new Storage();
|
sp<IStorage> service = new Storage();
|
||||||
LazyServiceRegistrar registrar;
|
auto registrar = LazyServiceRegistrar::getInstance();
|
||||||
status_t result = registrar.registerService(service);
|
status_t result = registrar.registerService(service);
|
||||||
|
|
||||||
if (result != OK) {
|
if (result != OK) {
|
||||||
|
|||||||
Reference in New Issue
Block a user