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

Commit 9cf785bd authored by Yin-Chia Yeh's avatar Yin-Chia Yeh
Browse files

Camera: fix dump/disconnect race

Keep camera device alive during dump.

Change-Id: I98f4fcdea5eb550c48257ab194bc621affb90b86
parent d9272a93
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -136,7 +136,12 @@ status_t CameraClient::dumpClient(int fd, const Vector<String16>& args) {
    const char *enddump = "\n\n";
    write(fd, enddump, strlen(enddump));

    return mHardware->dump(fd, args);
    sp<CameraHardwareInterface> hardware = mHardware;
    if (hardware != nullptr) {
        return hardware->dump(fd, args);
    }
    ALOGI("%s: camera device closed already, skip dumping", __FUNCTION__);
    return OK;
}

// ----------------------------------------------------------------------------