Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53829834 authored by Yifan Hong's avatar Yifan Hong
Browse files

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
parent b0f6304e
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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";
    }