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

Commit 91a123f1 authored by Brian Duddie's avatar Brian Duddie Committed by android-build-merger
Browse files

Avoid deadlock if HAL dies at init am: 6d2e3756

am: f0af1a73

Change-Id: I3956baead87bc76c8bd8b5c042c5775f0f6e671b
parents 3711ca93 f0af1a73
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1012,7 +1012,7 @@ void SensorDevice::convertToSensorEvents(
}

void SensorDevice::handleHidlDeath(const std::string & detail) {
    if (!SensorDevice::getInstance().mSensors->supportsMessageQueues()) {
    if (!mSensors->supportsMessageQueues()) {
        // restart is the only option at present.
        LOG_ALWAYS_FATAL("Abort due to ISensors hidl service failure, detail: %s.", detail.c_str());
    } else {
+3 −3
Original line number Diff line number Diff line
@@ -211,14 +211,14 @@ private:
    status_t batchLocked(void* ident, int handle, int flags, int64_t samplingPeriodNs,
                         int64_t maxBatchReportLatencyNs);

    static void handleHidlDeath(const std::string &detail);
    void handleHidlDeath(const std::string &detail);
    template<typename T>
    static void checkReturn(const Return<T>& ret) {
    void checkReturn(const Return<T>& ret) {
        if (!ret.isOk()) {
            handleHidlDeath(ret.description());
        }
    }
    static status_t checkReturnAndGetStatus(const Return<Result>& ret);
    status_t checkReturnAndGetStatus(const Return<Result>& ret);
    //TODO(b/67425500): remove waiter after bug is resolved.
    sp<SensorDeviceUtils::HidlServiceRegistrationWaiter> mRestartWaiter;