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

Commit 7f16ea4d authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

libaudiohal: Use 'exit' in HalDeathHandler instead of fatal log

Fatal log is registered as a process crash. Since these crash
reports do not bring in any useful info, it's better to just
exit the process instead.

Bug: 69379459
Test: kill audio HAL, check logcat
Change-Id: I0d83d496998248faf3669a1fe8c31944b839bb3e
parent a4fa4760
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -48,12 +48,13 @@ void HalDeathHandler::unregisterAtExitHandler(void* cookie) {

void HalDeathHandler::serviceDied(uint64_t /*cookie*/, const wp<IBase>& /*who*/) {
    // No matter which of the service objects has died,
    // we need to run all the registered handlers and crash our process.
    // we need to run all the registered handlers and exit.
    std::lock_guard<std::mutex> guard(mHandlersLock);
    for (const auto& handler : mHandlers) {
        handler.second();
    }
    LOG_ALWAYS_FATAL("HAL server crashed, need to restart");
    ALOGE("HAL server crashed, audio server is restarting");
    exit(1);
}

} // namespace android