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

Commit fd9d0603 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Probe PowerHAL HIDL first am: b8c5a0f9

Change-Id: Ie8f561e9fa8e3de982509a4e8d297ae774f0a3fd
parents e18c2625 b8c5a0f9
Loading
Loading
Loading
Loading
+15 −15
Original line number Diff line number Diff line
@@ -54,6 +54,21 @@ static hal_version connectPowerHalLocked() {
        return NONE;
    }

    if (gPowerHalHidlExists) {
        // (re)connect if handle is null
        if (!gPowerHal_1_2_) {
            gPowerHal_1_2_ =
                    android::hardware::power::V1_2::IPower::getService();
        }
        if (gPowerHal_1_2_) {
            ALOGI("Successfully connected to Power Hal Hidl service.");
            return HIDL_1_2;
        } else {
            // no more try on this handle
            gPowerHalHidlExists = false;
        }
    }

    if (gPowerHalAidlExists) {
        // (re)connect if handle is null
        if (!gPowerHal_Aidl_) {
@@ -70,21 +85,6 @@ static hal_version connectPowerHalLocked() {
        }
    }

    if (gPowerHalHidlExists) {
        // (re)connect if handle is null
        if (!gPowerHal_1_2_) {
            gPowerHal_1_2_ =
                    android::hardware::power::V1_2::IPower::getService();
        }
        if (gPowerHal_1_2_) {
            ALOGI("Successfully connected to Power Hal Hidl service.");
            return HIDL_1_2;
        } else {
            // no more try on this handle
            gPowerHalHidlExists = false;
        }
    }

    return NONE;
}