The California Supreme Court held that the first situation involves such a powerful use of authority that the city employing the officer can be held vicariously liable for his sexual torts. However, in Doe 1 v. City of Murrieta, the California Court of Appeal decided that the City cannot be held vicariously liable in the second situation.
Pennington, Tara L.
"Doe 1 v. City of Murrieta: How the California Court of Appeal Missed the Mark on Vicarious Liability for Sexual Torts Committed by On-Duty Police Officers,"
University of San Francisco Law Review: Vol. 37
, Article 6.
Available at: https://repository.usfca.edu/usflawreview/vol37/iss4/6