An Obata-type characterization of Calabi metrics on line bundles