diff options
author | Pooja Kumari <kumarip@codeaurora.org> | 2020-08-17 16:10:46 +0530 |
---|---|---|
committer | Pooja Kumari <kumarip@codeaurora.org> | 2020-08-24 12:29:47 +0530 |
commit | 5c5bd6395fe0b7375f1c8869e7f570e1dc2e5ead (patch) | |
tree | a8b29286a0d1653a211d3b7513b4ae8576ed8d6a | |
parent | 6facc43568f6de2ca4142bb497077639c83db7cd (diff) | |
download | ipacfg-mgr-5c5bd6395fe0b7375f1c8869e7f570e1dc2e5ead.tar.gz |
ipacm: using same-process HAL
Create same process HAL to avoid double registrations
Change-Id: I47fb46b727d0c66006f65a06586c11e4c42c3ea9
-rw-r--r-- | hal/inc/HAL.h | 2 | ||||
-rw-r--r-- | hal/src/HAL.cpp | 4 | ||||
-rw-r--r-- | ipacm/src/IPACM_Main.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/hal/inc/HAL.h b/hal/inc/HAL.h index 894438f..92ec135 100644 --- a/hal/inc/HAL.h +++ b/hal/inc/HAL.h @@ -123,7 +123,7 @@ public: * Yet, a major version update, would not be backwards compatible. This means that a 2.x HAL * could not linked into the same IPACM code base as a 1.x HAL. */ - static HAL* makeIPAHAL(int /* version */, IOffloadManager* /* mgr */); + static Return<::android::sp<HAL>> makeIPAHAL(int /* version */, IOffloadManager* /* mgr */); /* IOffloadConfig */ Return<void> setHandles( diff --git a/hal/src/HAL.cpp b/hal/src/HAL.cpp index 3f1a41f..f18767a 100644 --- a/hal/src/HAL.cpp +++ b/hal/src/HAL.cpp @@ -62,7 +62,7 @@ using ::std::vector; /* ------------------------------ PUBLIC ------------------------------------ */ -HAL* HAL::makeIPAHAL(int version, IOffloadManager* mgr) { +Return<::android::sp<HAL>> HAL::makeIPAHAL(int version, IOffloadManager* mgr) { android::hardware::ProcessState::initWithMmapSize((size_t)(2 * KERNEL_PAGE)); if (DBG) @@ -70,7 +70,7 @@ HAL* HAL::makeIPAHAL(int version, IOffloadManager* mgr) { (mgr != nullptr) ? "provided" : "null"); if (nullptr == mgr) return NULL; else if (version != 1) return NULL; - HAL* ret = new HAL(mgr); + ::android::sp<HAL> ret = new HAL(mgr); if (nullptr == ret) return NULL; configureRpcThreadpool(1, false); ret->registerAsSystemService("ipacm"); diff --git a/ipacm/src/IPACM_Main.cpp b/ipacm/src/IPACM_Main.cpp index ec5de34..ca75a4a 100644 --- a/ipacm/src/IPACM_Main.cpp +++ b/ipacm/src/IPACM_Main.cpp @@ -121,7 +121,7 @@ int ipa_reset_hw_index_counter(); #ifdef FEATURE_IPACM_HAL IPACM_OffloadManager* OffloadMng; - HAL *hal; + ::android::sp<HAL> hal; #endif /* start netlink socket monitor*/ |