Cal Pen Code § 666 (2004)
§ 666. Punishment for subsequent conviction of petit theft after prior
theft crime conviction
Every person who, having been convicted of petty theft, grand
theft, auto theft under Section 10851 of the Vehicle
Code, burglary, carjacking, robbery, or a felony violation of Section
496 and having served a term therefor in any penal institution or having been
imprisoned therein as a condition of probation for that offense, is
subsequently convicted of petty theft, then the person convicted of that
subsequent offense is punishable by imprisonment in the county jail not
exceeding one year, or in the state prison.