It doesn’t actually matter on a practical level. For PhD programs, it takes one year to qualify for California residency. It’s quite easy. Realistically, they don’t expect you to stay beyond the PhD program because most graduates must take work wherever they can find it - often out of state. It’s never been an issue, as far as I can tell.
Undergrad and MA programs may be different. I only have direct experience with a UC PhD program.
Not sure what the OP is actually planning, though…