diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2019-01-07 23:25:20 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-01-07 23:25:20 +0000 |
commit | 063024b1b621b3fecaeb21932292fa406b69b338 (patch) | |
tree | e9e2ce2b04f7538c61764e6fd2799c50c5355428 /health | |
parent | 1fe2196f11861d4c01f44438f0970a49c82e046e (diff) | |
parent | d2c86ff9107db04ac578aaa0efceb424366234a2 (diff) | |
download | android_hardware_interfaces-063024b1b621b3fecaeb21932292fa406b69b338.tar.gz android_hardware_interfaces-063024b1b621b3fecaeb21932292fa406b69b338.tar.bz2 android_hardware_interfaces-063024b1b621b3fecaeb21932292fa406b69b338.zip |
Merge "Make health storage HAL lazy"
Diffstat (limited to 'health')
-rw-r--r-- | health/storage/1.0/default/android.hardware.health.storage@1.0-service.rc | 2 | ||||
-rw-r--r-- | health/storage/1.0/default/service.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/health/storage/1.0/default/android.hardware.health.storage@1.0-service.rc b/health/storage/1.0/default/android.hardware.health.storage@1.0-service.rc index c6a142528..d5e1a296d 100644 --- a/health/storage/1.0/default/android.hardware.health.storage@1.0-service.rc +++ b/health/storage/1.0/default/android.hardware.health.storage@1.0-service.rc @@ -1,5 +1,7 @@ service vendor.health-storage-hal-1-0 /vendor/bin/hw/android.hardware.health.storage@1.0-service interface android.hardware.health.storage@1.0::IStorage default + oneshot + disabled class hal user system group system diff --git a/health/storage/1.0/default/service.cpp b/health/storage/1.0/default/service.cpp index a94503383..f4296f197 100644 --- a/health/storage/1.0/default/service.cpp +++ b/health/storage/1.0/default/service.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include <hidl/HidlLazyUtils.h> #include <hidl/HidlTransportSupport.h> #include "Storage.h" @@ -23,6 +24,7 @@ using android::status_t; using android::UNKNOWN_ERROR; using android::hardware::configureRpcThreadpool; using android::hardware::joinRpcThreadpool; +using android::hardware::LazyServiceRegistrar; using android::hardware::health::storage::V1_0::IStorage; using android::hardware::health::storage::V1_0::implementation::Storage; @@ -30,7 +32,8 @@ int main() { configureRpcThreadpool(1, true); sp<IStorage> service = new Storage(); - status_t result = service->registerAsService(); + LazyServiceRegistrar registrar; + status_t result = registrar.registerService(service); if (result != OK) { return result; |