code: public static boolean isPointOnPolyline(LatLng point, PolylineOptions polyline, boolean geodesic, double tolerance) {
          return PolyUtil.isLocationOnPath(point, polyline.getPoints(), geodesic, tolerance);
      }
docs: Is the point on the polyline
  
  @param point     point
  @param polyline  polyline
  @param geodesic  geodesic check flag
  @param tolerance distance tolerance
  @return true if on the line