livedisplay: Implement ISunlightEnhancement interface

Change-Id: I728653099f9a57a85f1ce2ffa93b4e62981208fa
This commit is contained in:
LuK1337
2021-09-18 04:48:30 +02:00
parent ada38b5fed
commit 21edb37c1f
5 changed files with 120 additions and 0 deletions

View File

@@ -21,6 +21,8 @@
#include <hidl/HidlTransportSupport.h>
#include <livedisplay/sdm/PictureAdjustment.h>
#include "SunlightEnhancement.h"
using ::android::OK;
using ::android::sp;
using ::android::status_t;
@@ -29,6 +31,8 @@ using ::android::hardware::joinRpcThreadpool;
using ::vendor::lineage::livedisplay::V2_0::sdm::PictureAdjustment;
using ::vendor::lineage::livedisplay::V2_0::sdm::SDMController;
using ::vendor::lineage::livedisplay::V2_0::ISunlightEnhancement;
using ::vendor::lineage::livedisplay::V2_0::implementation::SunlightEnhancement;
int main() {
status_t status = OK;
@@ -40,6 +44,7 @@ int main() {
std::shared_ptr<SDMController> controller = std::make_shared<SDMController>();
sp<PictureAdjustment> pa = new PictureAdjustment(controller);
sp<SunlightEnhancement> se = new SunlightEnhancement();
configureRpcThreadpool(1, true /*callerWillJoin*/);
@@ -50,6 +55,13 @@ int main() {
goto shutdown;
}
status = se->registerAsService();
if (status != OK) {
LOG(ERROR) << "Could not register service for LiveDisplay HAL SunlightEnhancement Iface ("
<< status << ")";
goto shutdown;
}
LOG(INFO) << "LiveDisplay HAL service is ready.";
joinRpcThreadpool();
// Should not pass this line