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

Commit baa2125a authored by David Lin's avatar David Lin
Browse files

Fix issue with double vibration trigger

This patch fixes an issue that cause duplicated calls to HAL even when
the first call succeeded.

Bug: 63667425
Test: manual test
Change-Id: I4c29e3c9872cc42ea143b3adda3a3defca728e71
parent ac77186d
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -73,12 +73,14 @@ Return<R> halCall(Return<R> (I::* fn)(Args0...), Args1&&... args1) {
        ret = (sHal == nullptr) ? NullptrStatus<R>()
                : (*sHal.*fn)(std::forward<Args1>(args1)...);

        if (!ret.isOk()) {
        if (ret.isOk()) {
            break;
        }

        ALOGE("Failed to issue command to vibrator HAL. Retrying.");
        // Restoring connection to the HAL.
        sHal = I::tryGetService();
    }
    }
    return ret;
}