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

Commit c448d6ba authored by Henri Chataing's avatar Henri Chataing Committed by Automerger Merge Worker
Browse files

Merge "Update fmtlib to 10.1.1" into main am: 64e1192a am: 332a8be5 am: cfe79116

parents 66e8c224 cfe79116
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -123,6 +123,10 @@ static void setLogLevel(int level) {
    android_atomic_write(level, &gLogLevel);
}

int32_t format_as(CameraService::StatusInternal s) {
  return fmt::underlying(s);
}

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

static const std::string sDumpPermission("android.permission.DUMP");
@@ -510,8 +514,8 @@ void CameraService::onDeviceStatusChanged(const std::string& cameraId,
    }

    if (newStatus == StatusInternal::NOT_PRESENT) {
        logDeviceRemoved(cameraId, fmt::sprintf("Device status changed from %d to %d", oldStatus,
                newStatus));
        logDeviceRemoved(cameraId, fmt::format("Device status changed from {} to {}",
                oldStatus, newStatus));

        // Set the device status to NOT_PRESENT, clients will no longer be able to connect
        // to this device until the status changes
@@ -537,8 +541,8 @@ void CameraService::onDeviceStatusChanged(const std::string& cameraId,
        removeStates(cameraId);
    } else {
        if (oldStatus == StatusInternal::NOT_PRESENT) {
            logDeviceAdded(cameraId, fmt::sprintf("Device status changed from %d to %d", oldStatus,
                    newStatus));
            logDeviceAdded(cameraId, fmt::format("Device status changed from {} to {}",
                    oldStatus, newStatus));
        }
        updateStatus(newStatus, cameraId);
    }
@@ -578,9 +582,9 @@ void CameraService::onDeviceStatusChanged(const std::string& id,
    if (updated) {
        std::string idCombo = id + " : " + physicalId;
        if (newStatus == StatusInternal::PRESENT) {
            logDeviceAdded(idCombo, fmt::sprintf("Device status changed to %d", newStatus));
            logDeviceAdded(idCombo, fmt::format("Device status changed to {}", newStatus));
        } else {
            logDeviceRemoved(idCombo, fmt::sprintf("Device status changed to %d", newStatus));
            logDeviceRemoved(idCombo, fmt::format("Device status changed to {}", newStatus));
        }
        // Avoid calling getSystemCameraKind() with mStatusListenerLock held (b/141756275)
        SystemCameraKind deviceKind = SystemCameraKind::PUBLIC;
+2 −0
Original line number Diff line number Diff line
@@ -693,6 +693,8 @@ private:
        UNKNOWN = static_cast<int32_t>(hardware::ICameraServiceListener::STATUS_UNKNOWN)
    };

    friend int32_t format_as(StatusInternal s);

    /**
     * Container class for the state of each logical camera device, including: ID, status, and
     * dependencies on other devices.  The mapping of camera ID -> state saved in mCameraStates
+3 −2
Original line number Diff line number Diff line
@@ -1063,7 +1063,7 @@ binder::Status CameraDeviceClient::createStream(
        res = STATUS_ERROR_FMT(CameraService::ERROR_INVALID_OPERATION,
                "Camera %s: Error creating output stream (%d x %d, fmt %x, dataSpace %x): %s (%d)",
                mCameraIdStr.c_str(), streamInfo.width, streamInfo.height, streamInfo.format,
                streamInfo.dataSpace, strerror(-err), err);
                static_cast<int>(streamInfo.dataSpace), strerror(-err), err);
    } else {
        int i = 0;
        for (auto& binder : binders) {
@@ -1160,7 +1160,8 @@ binder::Status CameraDeviceClient::createDeferredSurfaceStreamLocked(
    if (err != OK) {
        res = STATUS_ERROR_FMT(CameraService::ERROR_INVALID_OPERATION,
                "Camera %s: Error creating output stream (%d x %d, fmt %x, dataSpace %x): %s (%d)",
                mCameraIdStr.c_str(), width, height, format, dataSpace, strerror(-err), err);
                mCameraIdStr.c_str(), width, height, format, static_cast<int>(dataSpace),
                strerror(-err), err);
    } else {
        // Can not add streamId to mStreamMap here, as the surface is deferred. Add it to
        // a separate list to track. Once the deferred surface is set, this id will be
+2 −2
Original line number Diff line number Diff line
@@ -84,10 +84,10 @@ void Camera3IOStreamBase::dump(int fd, [[maybe_unused]] const Vector<String16> &
    status_t res = getEndpointUsage(&consumerUsage);
    if (res != OK) consumerUsage = 0;

    lines << fmt::sprintf("      State: %d\n", mState);
    lines << fmt::sprintf("      State: %d\n", static_cast<int>(mState));
    lines << fmt::sprintf("      Dims: %d x %d, format 0x%x, dataspace 0x%x\n",
            camera_stream::width, camera_stream::height,
            camera_stream::format, camera_stream::data_space);
            camera_stream::format, static_cast<int>(camera_stream::data_space));
    lines << fmt::sprintf("      Max size: %zu\n", mMaxSize);
    lines << fmt::sprintf("      Combined usage: 0x%" PRIx64 ", max HAL buffers: %d\n",
            mUsage | consumerUsage, camera_stream::max_buffers);
+1 −1
Original line number Diff line number Diff line
@@ -623,7 +623,7 @@ binder::Status createSurfaceFromGbp(
    if (format != HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED) {
        if (dataSpace != streamInfo.dataSpace) {
            std::string msg = fmt::sprintf("Camera %s:Surface dataSpace doesn't match: %d vs %d",
                    logicalCameraId.c_str(), dataSpace, streamInfo.dataSpace);
                    logicalCameraId.c_str(), static_cast<int>(dataSpace), static_cast<int>(streamInfo.dataSpace));
            ALOGE("%s: %s", __FUNCTION__, msg.c_str());
            return STATUS_ERROR(CameraService::ERROR_ILLEGAL_ARGUMENT, msg.c_str());
        }