“Local police officer” also includes any employee of a contracting agency that is a city, who is employed in a jail or a detention or correctional facility and having as his or her primary duty and responsibility the supervision and custody of persons committed to the jail or facility. It shall not include persons employed as clerks, typists, teachers, instructors, or psychologists or to provide food, maintenance, health, or supporting services, even though responsibility for custody and control of persons so committed may be incident to, or imposed in connection
with, that service.
This section shall not apply to any contracting agency nor to the employees of a contracting agency until the agency elects to be subject to this section by contract or by amendment to its contract with the board, made pursuant to Section 20474 or by express provision in its contract with the board.