California DOJ ties gun registration to your California D/L. They can cross reference any contact you have with LE using your DL # to pull up what you have registered to you at least with pistols. I have heard it being done when a gun was found at a traffic stop although there seemed to be an issue over specific SN’s on a pistol at least as far as the inquiry went.
The police are not your friends.