You're right....since this is California law then, yes, the officer was just doing his job....
Except....
when the officer asked for some ID after he had already verified that the handgun was empty and that the pedestrian was in fact complying with California law.
It's pretty standard for LEOs to obtain ID, regardless of the reason for the stop - no use letting criminals slip under the radar when it's so easy to run a check for warrants and previous violations.
Yes, it is rather standard...even if it violates our Constitutional Rights.