Unincorporated areas (Castro Valley, San Lorenzo, etc.) use county Building Inspection. Cities (Oakland, Fremont, Hayward, Berkeley) run their own permit operations.
How this fits with the state
The state authority here is California Contractors State License Board. The county file does not replace that — it adds the permit office, local overlays, and the actual filing path.