summaryrefslogtreecommitdiffstats
path: root/livedisplay/1.0/default/service.cpp
diff options
context:
space:
mode:
authorEthan Chen <intervigil@gmail.com>2018-04-25 23:15:06 -0700
committerEthan Chen <intervigil@gmail.com>2018-06-09 12:54:48 -0700
commit18f4e8d82033f0f68c64f785f7733e188a7578f0 (patch)
tree26daa3760c9e2951a413314ce6c882509c140d59 /livedisplay/1.0/default/service.cpp
parentf66d76e7affb0685ec86ca1f796790154dc4424f (diff)
downloadandroid_hardware_lineage_interfaces-18f4e8d82033f0f68c64f785f7733e188a7578f0.tar.gz
android_hardware_lineage_interfaces-18f4e8d82033f0f68c64f785f7733e188a7578f0.tar.bz2
android_hardware_lineage_interfaces-18f4e8d82033f0f68c64f785f7733e188a7578f0.zip
livedisplay: Don't use singletons for the stack
* Rely on plain RAII semantics with object lifetimes to manage resources instead of singletons. Change-Id: I5c5a06349574edc534c2814cb30da9cb04f72578
Diffstat (limited to 'livedisplay/1.0/default/service.cpp')
-rw-r--r--livedisplay/1.0/default/service.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/livedisplay/1.0/default/service.cpp b/livedisplay/1.0/default/service.cpp
index b8f5cb5..026c26c 100644
--- a/livedisplay/1.0/default/service.cpp
+++ b/livedisplay/1.0/default/service.cpp
@@ -39,21 +39,14 @@ using ::vendor::lineage::livedisplay::V1_0::implementation::Color;
int main() {
status_t status;
- android::sp<IColor> service = nullptr;
-
LOG(INFO) << "LiveDisplay HAL service is starting.";
// The LiveDisplay HAL may communicate to other vendor components via /dev/vndbinder
android::ProcessState::initWithDriver("/dev/vndbinder");
- service = Color::getInstance();
- if (service == nullptr) {
- LOG(ERROR) << "Can not create an instance of LiveDisplay HAL Iface, exiting.";
- goto shutdown;
- }
-
configureRpcThreadpool(1, true /*callerWillJoin*/);
+ android::sp<IColor> service = new Color();
status = service->registerAsService();
if (status != OK) {
LOG(ERROR) << "Could not register service for LiveDisplay HAL Iface (" << status << ")";