public static void saveLayerCompat(Canvas canvas, RectF rect, Paint paint, int flag) {
    if (L.isTraceEnabled()) {
      L.beginSection("Utils#saveLayer");
    }
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
      // This method was deprecated in API level 26 and not recommended since 22, but its
      // 2-parameter replacement is only available starting at API level 21.
      canvas.saveLayer(rect, paint, flag);
    } else {
      canvas.saveLayer(rect, paint);
    }
    if (L.isTraceEnabled()) {
      L.endSection("Utils#saveLayer");
    }
  }
From http://vaibhavblogs.org/2012/12/common-java-networking-exceptions/
lottie/src/main/java/com/airbnb/lottie/utils/Utils.java