mirror of
				https://github.com/oplus-giulia-dev/android_hardware_oplus
				synced 2025-11-04 05:45:34 +08:00 
			
		
		
		
	Introduce vendor.oplus.hardware.commondcs-service
Change-Id: I4d91094cc2274a168b147a53d5ebe412a867e920
This commit is contained in:
		
							
								
								
									
										22
									
								
								aidl/commondcs/Android.bp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								aidl/commondcs/Android.bp
									
									
									
									
									
										Normal 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",
 | 
			
		||||
    ],
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										26
									
								
								aidl/commondcs/CommonDcsAidlHalService.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								aidl/commondcs/CommonDcsAidlHalService.cpp
									
									
									
									
									
										Normal 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
 | 
			
		||||
							
								
								
									
										27
									
								
								aidl/commondcs/CommonDcsAidlHalService.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								aidl/commondcs/CommonDcsAidlHalService.h
									
									
									
									
									
										Normal 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
 | 
			
		||||
							
								
								
									
										27
									
								
								aidl/commondcs/service.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								aidl/commondcs/service.cpp
									
									
									
									
									
										Normal 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
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,4 @@
 | 
			
		||||
service vendor.commondcs /vendor/bin/hw/vendor.oplus.hardware.commondcs-service
 | 
			
		||||
    class hal
 | 
			
		||||
    user system
 | 
			
		||||
    group system
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -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>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user