diff options
author | Yifan Hong <elsk@google.com> | 2017-11-07 15:02:10 -0800 |
---|---|---|
committer | Yifan Hong <elsk@google.com> | 2017-11-10 07:58:09 +0000 |
commit | 5382983429b732710b2f868298b708e5204f646a (patch) | |
tree | 0e5beba6906d7f4fe729ece664bc2ca577e4e12f /healthd | |
parent | b0f6304e82668886fa050bee0745c83f0aab8088 (diff) | |
download | core-5382983429b732710b2f868298b708e5204f646a.tar.gz core-5382983429b732710b2f868298b708e5204f646a.tar.bz2 core-5382983429b732710b2f868298b708e5204f646a.zip |
healthd: remove global binder fd
It is not used elsewhere, so a local variable is
sufficient.
Also fix a shared lib order in soong file.
Test: health VTS test
Bug: 63702641
Change-Id: I53cc208d8dd388fc89119c0044c5e30acf0740fb
Diffstat (limited to 'healthd')
-rw-r--r-- | healthd/HealthServiceCommon.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/healthd/HealthServiceCommon.cpp b/healthd/HealthServiceCommon.cpp index 160db77a7..260ca78a3 100644 --- a/healthd/HealthServiceCommon.cpp +++ b/healthd/HealthServiceCommon.cpp @@ -36,8 +36,6 @@ using android::hardware::health::V2_0::implementation::Health; // see healthd_common.cpp android::sp<IHealth> gHealth; -static int gBinderFd; - extern int healthd_main(void); static void binder_event(uint32_t /*epevents*/) { @@ -45,14 +43,16 @@ static void binder_event(uint32_t /*epevents*/) { } void healthd_mode_service_2_0_init(struct healthd_config* config) { + int binderFd; + LOG(INFO) << LOG_TAG << " Hal is starting up..."; configureRpcThreadpool(1, false /* callerWillJoin */); IPCThreadState::self()->disableBackgroundScheduling(true); - IPCThreadState::self()->setupPolling(&gBinderFd); + IPCThreadState::self()->setupPolling(&binderFd); - if (gBinderFd >= 0) { - if (healthd_register_event(gBinderFd, binder_event)) + if (binderFd >= 0) { + if (healthd_register_event(binderFd, binder_event)) LOG(ERROR) << LOG_TAG << ": Register for binder events failed"; } |