Heavy flavors in AA collisions: production, transport and final spectra