private static StaticLayout getStaticLayoutMaybeMaxLines(
      CharSequence text,
      int start,
      int end,
      TextPaint paint,
      int width,
      Layout.Alignment alignment,
      float spacingMult,
      float spacingAdd,
      boolean includePadding,
      @Nullable TextUtils.TruncateAt ellipsize,
      int ellipsisWidth,
      int maxLines,
      TextDirectionHeuristicCompat textDirection) {
    try {
      return StaticLayoutProxy.create(
          text,
          start,
          end,
          paint,
          width,
          alignment,
          spacingMult,
          spacingAdd,
          includePadding,
          // NULLSAFE_FIXME[Parameter Not Nullable]
          ellipsize,
          ellipsisWidth,
          maxLines,
          textDirection);
    } catch (LinkageError e) {
      // Use the publicly available constructor.
    }

    return getStaticLayoutNoMaxLines(
        text,
        start,
        end,
        paint,
        width,
        alignment,
        spacingMult,
        spacingAdd,
        includePadding,
        ellipsize,
        ellipsisWidth);
  }
Returns a StaticLayout using ICS specific constructor if possible.

@param text The text for the layout
@param start The start index
@param end The end index
@param paint The {@link TextPaint} to be used
@param width The width of the layout
@param alignment The {@link Layout.Alignment}
@param spacingMult The line spacing multiplier
@param spacingAdd The line spacing extra
@param includePadding Whether to include font padding
@param ellipsize The ellipsizing behavior specified by {@link TextUtils.TruncateAt}
@param ellipsisWidth The width of the ellipsis
@param maxLines The maximum number of lines for this layout
@param textDirection The text direction
@return A {@link StaticLayout}
library/src/main/java/com/facebook/fbui/textlayoutbuilder/StaticLayoutHelper.java