Cal. Penal Code § 626.85
(a) Any specified drug offender who, at any time, comes into any school building or upon any school ground, or adjacent street, sidewalk, or public way, unless the person is a parent or guardian of a child attending that school and his or her presence is during any school activity, or is a student at the school and his or her presence is during any school activity, or has prior written permission for the entry from the chief administrative officer of that school, is guilty of a misdemeanor if he or she does any of the following:
(3) Has otherwise established a continued pattern of unauthorized entry.
This section shall not be utilized to impinge upon the lawful exercise of constitutionally protected rights of freedom of speech or assembly, or to prohibit any lawful act, including picketing, strikes, or collective bargaining.
(b) Punishment for violation of this section shall be as follows:
(c) As used in this section:
(1) “Specified drug offender” means any person who, within the immediately preceding three years, has a felony or misdemeanor conviction of either: