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

Commit 7f688edc authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Android (Google) Code Review
Browse files

Merge "Camera: Ensure correct error message for disconnected devices" into nyc-dev

parents b4ee46c7 6192b892
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -147,12 +147,12 @@ status_t CameraClient::checkPid() const {
}

status_t CameraClient::checkPidAndHardware() const {
    status_t result = checkPid();
    if (result != NO_ERROR) return result;
    if (mHardware == 0) {
        ALOGE("attempt to use a camera after disconnect() (pid %d)", getCallingPid());
        return INVALID_OPERATION;
    }
    status_t result = checkPid();
    if (result != NO_ERROR) return result;
    return NO_ERROR;
}

+4 −0
Original line number Diff line number Diff line
@@ -1050,6 +1050,10 @@ void CameraDeviceClient::onResultAvailable(const CaptureResult& result) {
}

binder::Status CameraDeviceClient::checkPidStatus(const char* checkLocation) {
    if (mDisconnected) {
        return STATUS_ERROR(CameraService::ERROR_DISCONNECTED,
                "The camera device has been disconnected");
    }
    status_t res = checkPid(checkLocation);
    return (res == OK) ? binder::Status::ok() :
            STATUS_ERROR(CameraService::ERROR_PERMISSION_DENIED,