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

Commit 1ba4041b authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

audiohal: Exit instead of crashing when HAL factory can't be obtained

Replace LOG_ALWAYS_FATAL with ALOGE + exit, so the process still
restarts, but without a crash. This avoids confusion in bug triaging
and also helps to eliminate noise in bug reports statistics.

Bug: 36424777
Change-Id: I623cbc6a5b0d3351f849810dd67708d421efd61a
Test: reproduced error condition, checked that audio server restarts
parent 5a1ebf93
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -45,7 +45,8 @@ DevicesFactoryHalHidl::DevicesFactoryHalHidl() {
        // and thus have the same lifespan.
        mDevicesFactory->linkToDeath(HalDeathHandler::getInstance(), 0 /*cookie*/);
    } else {
        LOG_ALWAYS_FATAL("Failed to obtain IDevicesFactory service");
        ALOGE("Failed to obtain IDevicesFactory service, terminating process.");
        exit(1);
    }
}

+4 −1
Original line number Diff line number Diff line
@@ -44,7 +44,10 @@ bool EffectsFactoryHalInterface::isNullUuid(const effect_uuid_t *pEffectUuid) {

EffectsFactoryHalHidl::EffectsFactoryHalHidl() : ConversionHelperHidl("EffectsFactory") {
    mEffectsFactory = IEffectsFactory::getService();
    LOG_ALWAYS_FATAL_IF(mEffectsFactory == 0, "Failed to obtain IEffectsFactory service");
    if (mEffectsFactory == 0) {
        ALOGE("Failed to obtain IEffectsFactory service, terminating process.");
        exit(1);
    }
}

EffectsFactoryHalHidl::~EffectsFactoryHalHidl() {