There are requirements beyond that including that it's unrelated to anything your employer does. If you work at Google or a similarly broad tech giant, unfortunately that means they probably own the IP of almost anything you could do despite California's otherwise generous law.
I wish the law was worded such that it just had to be unrelated to the work that employee does for the employer, but it was not written with that forsight.
This is true, but the idea of that law is to ensure you don't steal any intellectual property and don't compete with your company, not that you may not code at all under these circumstances.
This is the default law in most states. California and Washington both have the additional law that states the company cannot contractually take away this right where is most other states they can within certain limits. Of course the legality is moot if they decide to throw enough money at it as they will just bankrupt you with legal fees.
From what I understand the burden of proof in Lab. Code, § 2872. falls on the employee. If they work on some code in their "spare" time and that code contains a license with the word "Google" in it it would seem the license is a first attempt to establish the burden of proof as opposed to the freedoms one might enjoy writing under the Expat or GPL, for example.