Introduce vendor.oplus.hardware.commondcs-service

Change-Id: I4d91094cc2274a168b147a53d5ebe412a867e920
This commit is contained in:
Bruno Martins
2025-02-09 23:22:17 +00:00
parent 9f1f2c1765
commit 5134fa4830
7 changed files with 121 additions and 0 deletions

22
aidl/commondcs/Android.bp Normal file
View File

@@ -0,0 +1,22 @@
//
// Copyright (C) 2025 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
cc_binary {
name: "vendor.oplus.hardware.commondcs-service",
vendor: true,
relative_install_path: "hw",
init_rc: ["vendor.oplus.hardware.commondcs-service.rc"],
vintf_fragments: ["vendor.oplus.hardware.commondcs-service.xml"],
srcs: [
"CommonDcsAidlHalService.cpp",
"service.cpp",
],
shared_libs: [
"libbase",
"libbinder_ndk",
"vendor.oplus.hardware.commondcs-V1-ndk",
],
}

View File

@@ -0,0 +1,26 @@
/*
* Copyright (C) 2025 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "CommonDcsAidlHalService.h"
namespace aidl {
namespace vendor {
namespace oplus {
namespace hardware {
namespace commondcs {
ndk::ScopedAStatus CommonDcsAidlHalService::notifyMsgToCommonDcs(
const std::vector<StringPair>& data, const std::string& logTag, const std::string& eventId,
int32_t* _aidl_return) {
*_aidl_return = 0;
return ndk::ScopedAStatus::ok();
}
} // namespace commondcs
} // namespace hardware
} // namespace oplus
} // namespace vendor
} // namespace aidl

View File

@@ -0,0 +1,27 @@
/*
* Copyright (C) 2025 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <aidl/vendor/oplus/hardware/commondcs/BnCommonDcsAidlHalService.h>
namespace aidl {
namespace vendor {
namespace oplus {
namespace hardware {
namespace commondcs {
struct CommonDcsAidlHalService : public BnCommonDcsAidlHalService {
ndk::ScopedAStatus notifyMsgToCommonDcs(const std::vector<StringPair>& data,
const std::string& logTag, const std::string& eventId,
int32_t* _aidl_return) final;
};
} // namespace commondcs
} // namespace hardware
} // namespace oplus
} // namespace vendor
} // namespace aidl

View File

@@ -0,0 +1,27 @@
/*
* Copyright (C) 2025 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "CommonDcsAidlHalService.h"
#include <android-base/logging.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
using ::aidl::vendor::oplus::hardware::commondcs::CommonDcsAidlHalService;
int main() {
ABinderProcess_setThreadPoolMaxThreadCount(0);
std::shared_ptr<CommonDcsAidlHalService> service =
ndk::SharedRefBase::make<CommonDcsAidlHalService>();
const std::string instance = std::string() + CommonDcsAidlHalService::descriptor + "/default";
binder_status_t status =
AServiceManager_addService(service->asBinder().get(), instance.c_str());
CHECK_EQ(status, STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
}

View File

@@ -0,0 +1,4 @@
service vendor.commondcs /vendor/bin/hw/vendor.oplus.hardware.commondcs-service
class hal
user system
group system

View File

@@ -0,0 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>vendor.oplus.hardware.commondcs</name>
<version>1</version>
<fqname>ICommonDcsAidlHalService/default</fqname>
</hal>
</manifest>

View File

@@ -58,6 +58,14 @@
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.oplus.hardware.commondcs</name>
<version>1</version>
<interface>
<name>ICommonDcsAidlHalService</name>
<instance>default</instance>
</interface>
</hal>
<hal format="aidl" optional="true">
<name>vendor.oplus.hardware.communicationcenter</name>
<version>1-2</version>