SAN DIEGO — A man opened fire immediately on a San Diego police officer who walked up to him on a dark residential street last week to ask if he lived nearby, prosecutors said, then shot into a patrol car, hitting the officer’s partner with five bullets as he sat wearing a seatbelt. Jesse Gomez