Filed 9/5/24 P v. Heimlich CA4/3

NOT TO BE PUBLISHED IN OFFICIAL REPORTS

California Rules of Court, rule 8.1115(a), prohibits courts and parties from citing or relying on opinions not certified for 

publication or ordered published, except as specified by rule 8.1115(b). This opinion has not been certified for publication

or ordered published for purposes of rule 8.1115. 

IN THE COURT OF APPEAL OF THE STATE OF CALIFORNIA

FOURTH APPELLATE DISTRICT

DIVISION THREE

THE PEOPLE,

 Plaintiff and Respondent,

v.

KENNETH ALEXANDER 

HEIMLICH,

 Defendant and Appellant.

 G061974

 (Super. Ct. No. 19NF1502)

 O P I N I O N

Appeal from a judgment of the Superior Court of Orange County, 

Gary S. Paer, Judge. Reversed in part and remanded with directions.

Steven S. Lubliner, under appointment by the Court of Appeal, 

for Defendant and Appellant.

Rob Bonta, Attorney General, Charles C. Ragland, Assistant 

Attorney General, A. Natasha Cortina and Elizabeth M. Renner, Deputy 

Attorneys General, for Plaintiff and Respondent.

* * *
2

A criminal defendant is entitled to credits for the number of days 

spent in custody prior to sentencing (custody credits). Ordinarily, a trial court 

also grants additional credits for good conduct based on a formula devised by 

the Legislature (conduct credits). (Pen. Code, § 4019.)1

If a defendant is mentally incompetent to stand trial, proceedings 

are suspended. Incompetent defendants are usually treated while in custody

in a state mental hospital, but incompetent defendants can also be treated 

while in custody in a county jail. (See § 1368 et seq.)

Incompetent defendants are currently entitled to conduct credits 

regardless of whether they are housed in a state mental hospital or a county 

jail. (§ 4019.) But in an earlier version of section 4019 (effective 2019 through 

2021), incompetent defendants housed in state hospitals did not have the 

opportunity to earn conduct credits, while incompetent defendants housed in 

county jails did have the opportunity to earn conduct credits.

The sole issue in this appeal is whether this temporary unequal 

treatment of incompetent defendants violated the equal protection clause.

There is presently a split of authority among the appellate courts. (People v. 

Orellana (2022) 74 Cal.App. 5th 319 [finding no equal protection violation]; 

People v. Yang (2022) 78 Cal.App.5th 120 (Yang) [finding an equal protection 

violation]; People v. Shkrabak (2023) 89 Cal.App.5th 943 (Shkrabak) [same].) 

We agree with the holdings in Yang and Shkrabak.

Kenneth Alexander Heimlich was charged with several crimes

and found incompetent to stand trial. From October 2020 to February 2021, 

Heimlich was treated in a state mental hospital and restored to competency. 

Heimlich was later tried and convicted. When imposing a sentence, the trial 

1 Undesignated statutory references are to the Penal Code.
3

court did not award Heimlich conduct credits for the time he was housed in 

the state hospital. We find this was an equal protection violation.

Thus, we reverse Heimlich’s sentence and remand for 

recalculation of his presentence custody and/or conduct credits. In all other 

respects, the judgment is affirmed.

I.

FACTS AND PROCEDURAL BACKGROUND

In June 2019, Heimlich tried to take a bicycle from a man. When 

the man refused to give up his bicycle, Heimlich severely beat him. Later that 

day, Heimlich severely beat a second man and took his wallet. Heimlich then 

punched a third man who tried to intervene. During his processing into jail, 

Heimlich took off his shoes and threw them at an officer.

In September 2019, the prosecution filed an information charging 

Heimlich with various crimes: attempted murder, robbery, assault with 

means of force likely to cause great bodily injury, battery with serious bodily 

injury, and battery on a police officer. Great bodily injury enhancements were 

also alleged as to some of the charges.

In December 2019, the trial court found Heimlich incompetent to 

stand trial and suspended criminal proceedings. In January 2020, the court 

ordered Heimlich to be delivered to the custody of the Department of State 

Hospitals. In October 2020, Heimlich was admitted to Atascadero State 

Hospital. In February 2021, the Medical Director signed a “Certificate of 

Mental Competency,” and Heimlich was later returned to the county jail.

In February 2021, the trial court found Heimlich competent to 

stand trial and proceedings were reinstated. In August 2022, after an eightday trial, the jury could not reach a verdict as to the attempted murder
4

charge and the prosecution dismissed that charge. The jury found Heimlich 

guilty of the remaining charges or lesser included offenses. The jury also 

found true three great bodily injury allegations.

In October 2022, the trial court sentenced Heimlich to a 10-year 

prison term. The court awarded 1,344 days of presentence credits to be 

applied against Heimlich’s prison term (1,235 custody credits and 109 

conduct credits).2 The court found Heimlich was not entitled to conduct 

credits for the time he spent in the Atascadero State Hospital because of the 

version of section 4019 that was in effect during his hospital commitment.

II.

DISCUSSION

From January 1, 2019, to December 31, 2021, incompetent 

defendants housed in state hospitals did not have the opportunity to earn 

conduct credits, while incompetent defendants housed in county jails did 

have the opportunity to earn conduct credits. In this appeal, Heimlich claims 

this version of section 4019 violated the equal protection clause. We agree.

Heimlich’s equal protection claim is a challenge to a prior version 

of section 4019. This is a pure question of law; therefore, we apply an 

independent standard of review. (See Yang, supra, 78 Cal.App.5th at p. 125

[equal protection challenge to section 4019 is reviewed de novo].)

In the remainder of this discussion, we shall: A) review relevant 

legal principles regarding presentence credits; B) review relevant legal 

2 There are discrepancies in the record as to the precise date 

when Heimlich began his state hospital commitment. At sentencing, the trial 

court determined Heimlich had spent 512 days in the hospital, but the 

parties agree this calculation was in error.
5

principles regarding the equal protection clause; and C) analyze whether the 

version of section 4019 that was in effect from January 1, 2019, to December 

31, 2021, violated the equal protection clause.

A. Presentence Credits

A defendant convicted of a felony is generally entitled to credits

applied against an eventual “term of imprisonment” for any actual time spent 

in custody before sentencing (custody credits). (§ 2900.5, subd. (a).) The 

location of a defendant’s custody commitment includes “any time spent in a 

jail, camp, work furlough facility, halfway house, rehabilitation facility, 

hospital, prison, juvenile detention facility, or similar residential institution.”

(§ 2900.5, subd. (a), italics added.)

In addition to custody credits, additional credits are ordinarily 

available to a prisoner for good conduct during presentence confinement 

(conduct credits). (§ 4019.) “For each four-day period in which a prisoner is 

confined in or committed to a facility as specified in this section, one day shall 

be deducted from the prisoner’s period of confinement unless it appears by 

the record that the prisoner has not satisfactorily complied with the 

reasonable rules and regulations established by the sheriff, chief of police, or 

superintendent of an industrial farm or road camp.” (§ 4019, subd. (c).)

“Historically, ‘section 4019 has provided that defendants confined 

in specific facilities and various settings may earn conduct credit for 

performing assigned labor and for complying with applicable rules and 

regulations.’” (Shkrabak, supra, 89 Cal.App.5th at pp. 947–948.) Prior to 

January 1, 2019, incompetent defendants who were treated in state hospitals 

or other facilities were not statutorily eligible for conduct credits under 

section 4019. (Yang, supra, 78 Cal.App.5th at p. 125.)
6

Effective January 1, 2019, Senate Bill No. 1187 amended section 

4019 by adding subdivision (a)(8). Section 4019 now provided that prisoners 

undergoing competency restoration treatment in county jail facilities would 

be eligible for conduct credits. (Stats. 2018, ch. 1008, § 5.)

“Senate Bill 1187 was enacted to ensure that [incompetent] 

defendants being held and treated in county jail would be entitled to earn 

conduct credits just as other jail inmates. (Assem. Com. On Public Safety, 

Rep. on Sen. Bill No. 1187 (2017–2018 Reg. Sess.) as amended May 25, 2018, 

p. 5.) Although legislative analyses reflected the Legislature’s express 

awareness that [incompetent] defendants in a state hospital were not 

statutorily or constitutionally entitled to conduct credit under [former] 

section 4019, the analyses disclosed no explanation why the Legislature—at 

that point—declined to similarly extend the availability of conduct credit to 

such defendants.” (Yang, supra, 78 Cal.App.5th at pp. 126-127.)

Effective January 1, 2022, Senate Bill No. 317 further amended 

section 4019 to provide that prisoners receiving competency treatment in a 

state hospital could now also receive conduct credits.3(Stats. 2021, ch. 599, § 

3, eff. Jan. 1, 2022.) “The legislative history indicates the bill was meant to 

‘ensure[] incompetent defendants are eligible for the same time served credit 

for good conduct as their competent counterparts, while receiving treatment 

in any treatment facility or as an outpatient, not just . . . county jail 

treatment.’” (Yang, supra, 78 Cal.App.5th at p. 127.)

Consequently, from January 1, 2019, to December 31, 2021, 

3

“When a prisoner is confined in or committed to a state hospital

or other mental health treatment facility, or to a county jail treatment facility 

in [mental incompetency] proceedings . . . .” (§ 4019, subd. (a)(8), italics 

added.)
7

incompetent defendants housed in state hospitals were not able to earn 

conduct credits under section 4019, while incompetent defendants housed in 

county jails were able to earn conduct credits under section 4019. The sole 

issue in this appeal is whether this temporary unequal treatment of 

incompetent defendants was an equal protection violation.

B. Equal Protection

“The equal protection clause . . . provides that no state may ‘deny 

to any person within its jurisdiction the equal protection of the laws.’ 

[Citation.] This provision is ‘essentially a direction that all persons similarly 

situated should be treated alike.’ [Citation.] ‘At core, the requirement of equal 

protection ensures that the government does not treat a group of people 

unequally without some justification.’” (People v. Hardin (2024) 15 Cal.5th 

834, 847, fn. omitted.)

The California Supreme Court recently clarified how California 

state courts are to approach the analysis of facial challenges to statutes on 

equal protection grounds. (Hardin, supra, 15 Cal.5th at pp. 850–851.) The 

Court held that “when plaintiffs challenge laws drawing distinctions between 

identifiable groups or classes of persons, on the basis that the distinctions 

drawn are inconsistent with equal protection, courts no longer need to ask at 

the threshold whether the two groups are similarly situated for purposes of 

the law in question. The only pertinent inquiry is whether the challenged 

difference in treatment is adequately justified under the applicable standard 

of review.” (Ibid.)

“‘“[I]n cases involving ‘suspect classifications’ or touching on 

‘fundamental interests’ . . . courts . . . subject[] the classifications to strict 

scrutiny.”’ [Citation.] Under strict scrutiny, ‘“‘the state bears the burden of 
8

establishing not only that it has a compelling interest which justifies the law 

but that the distinctions drawn by the law are necessary to further its 

purpose.’”’” (Yang, supra, 78 Cal.App.5th at p. 131.) The strict scrutiny test 

requires that the law being challenged is both narrowly tailored and the least 

restrictive means possible to achieve a compelling governmental interest. 

(San Antonio School District v. Rodriguez (1973) 411 U.S. 1, 16–17.)

“‘[W]here the law challenged neither draws a suspect 

classification nor burdens fundamental rights, the question we ask is 

different. We find a denial of equal protection only if there is no rational 

relationship between a disparity in treatment and some legitimate 

government purpose.’” (Yang, supra, 78 Cal.App.5th at p. 131.)

C. Application and Analysis

Again, this case concerns only the former version of section 4019

that was in effect from January 1, 2019, to December 31, 2021. Specifically, 

the equal protection question is whether section 4019’s temporary denial of 

conduct credits to incompetent defendants housed in state hospitals (as 

opposed to those housed in county jails) was justified under the appropriate 

standard of review (strict scrutiny or rational basis).

The parties disagree on whether the strict scrutiny or the 

rational basis test applies to Heimlich’s equal protection claim. Heimlich 

argues the strict scrutiny test applies because his inability to earn conduct 

credits effectively increased the number of days he must spend in prison, and 

therefore his fundamental liberty rights are burdened by section 4019’s 

unequal treatment of incompetent defendants. (See People v. Lara (2012) 54 

Cal.4th 896, 905–906 [“We need not take issue with the proposition that a 

person who is released a day early is punished a day less. The very purpose of 
9

conduct credits is to foster constructive behavior in prison by reducing 

punishment”].) The Attorney General argues that the rational basis test 

applies because it “appears more appropriate.” We find that Heimlich plainly 

has the better argument.

As the Attorney General concedes, the California Supreme Court 

has “applied strict scrutiny, also referred to as the compelling state interest

test, to evaluate disparities in the law concerning credit allowances.” For 

instance, the Court held that the denial of conduct credits to mentally 

disordered sex offenders (MDSOs) affected their “fundamental” personal 

liberty interests; therefore, the Court in that case applied the strict scrutiny

or compelling state interest test in an equal protection challenge. (People v. 

Saffell (1979) 25 Cal.3d 223, 228; see also People v. Sage (1980) 26 Cal.3d 

498, 506–508 [compelling state interest test applied to law affecting conduct 

credits]; People v. Waterman (1986) 42 Cal.3d 565, 569 [same].)

Nonetheless, the Attorney General cites two appellate court 

opinions involving conduct credits where “courts have applied rational basis 

review.” (People v. Rajanayagam (2012) 211 Cal.App.4th 42, 53; In re Bender

(1983) 149 Cal.App.3d 380, 388–389.) However, we must obviously follow the 

precedents of the California Supreme Court, which has applied the strict 

scrutiny test. (See Auto Equity Sales, Inc. v. Superior Court (1962) 57 Cal.2d 

450, 455 [“The decisions of this court are binding upon and must be followed 

by all the state courts”].)

In any event, the appellate court opinions cited by the Attorney 

General are distinguishable on their merits. (See People v. Rajanayagam, 

supra, 211 Cal.App.4th 42; In re Bender, supra, 149 Cal.App.3d 380.) In both 

cases, the defendants argued that amendments to section 4019 that were 

favorable to them should apply retroactively. But as the Supreme Court has 
10

made clear, the equal protection clause cannot be used by a defendant to 

challenge the Legislature’s discretion to make prospective-only changes to the 

law. (People v. Brown (2012) 54 Cal.4th 314, 329–330; see also Yang, supra, 

78 Cal.App.5th at p. 130 [“In holding that the prospective-only application of 

the 2009 amendment did not violate equal protection principles, Brown was 

essentially rejecting the defendant’s attempt to make an end-run around the 

amendment’s non-retroactive application”].)

Here, Heimlich does not argue that the January 1, 2022, 

amendment to section 4019, which extended conduct credits to incompetent 

defendants in state hospitals applies retroactively. “Instead, the instant case 

concerns the disparate treatment of two groups of [incompetent] defendants 

whose confinement for competency treatment postdated [an earlier] statutory 

amendment [effective January 1, 2019,] that authorizes conduct credits only 

for those committed to a jail facility but not for those committed to a state 

hospital.” (Yang, supra, 78 Cal.App.5th at pp. 130–131.)

To reiterate, we must apply the strict scrutiny (or compelling 

governmental interest) test to Heimlich’s facial challenge to section 4019

under the equal protection clause. (See People v. Saffell, supra, 25 Cal.3d at 

p. 228; People v. Sage, supra, 26 Cal.3d at pp. 506–508 & fn. 6; People v. 

Waterman, supra, 42 Cal.3d at p. 569.)

Having resolved which equal protection test applies, we now 

proceed to analyze the state’s (i.e., the Attorney General’s) proffered 

justifications for not granting custody credits to incompetent defendants 

housed in state mental hospitals. (See Yang, supra, 78 Cal.App.5th at p. 136 

[“under strict scrutiny, ‘“the state must first establish that it has a compelling

interest which justifies the law and then demonstrate that the distinctions 

drawn by the law are necessary to further that purpose”’”].)
11

The Attorney General appears to be proffering four justifications 

as to why the Legislature (for a three-year period) did not allow incompetent 

defendants who were being treated and restored to competency in state 

hospitals to earn conduct credits, while at the same time the Legislature did 

allow incompetent defendants who were being treated and restored to 

competency in county jails to earn conduct credits.

The Attorney General’s first proffered justification is that the 

purpose of conduct credits is for a prisoner to conform to jail regulations; 

therefore, he argues: “The Legislature could have concluded that this 

incentive to behave remains appropriate to the jail setting, . . . but not 

necessary[ily] for those undergoing treatment in a state hospital, who are not 

around general population prisoners.” (Italics added.)

But as the appellate court reasoned in Yang, “state hospitals—

like jails—are structured environments governed by various rules. 

[Citations.] Thus, the same interest in incentivizing good behavior appears 

equally reasonable and workable for defendants receiving competency 

treatment in a state hospital where patients with varying issues and/or 

criminal histories or proclivities are housed. [Citations.] Finally, the notion 

that the availability of conduct credit would serve no purpose for 

[incompetent] defendants confined in a state hospital is undermined by the 

recent passage of Senate Bill 317 which, effective January 1, 2022, amended 

section 4019 to extend conduct credit to such defendants.” (Yang, supra, 78 

Cal.App.5th at p. 136.) We agree with the analysis in Yang and reject the 

Attorney General’s first proffered justification.

The Attorney General’s second proffered justification is: “The 

Legislature could have also rationally concluded that those receiving 

competency restoration in a county jail treatment facility receive a different, 
12

and not as comprehensive treatment as those who receive competency 

restoration in a state hospital.”

But the Attorney General offers no facts to support the premise of 

his argument, which is that incompetent defendants receive different kinds of 

treatment depending upon where they are housed. In any event, even if we 

were to accept this premise as true, we cannot fathom why the Legislature 

would not want to incentivize good behavior by incompetent defendants 

regardless of the kinds of treatment they may be receiving, and regardless of 

the location where they may be receiving the treatment (a hospital or a 

county jail). In short, we reject the Attorney General’s second proffered 

justification under the compelling state interest (strict scrutiny) test.

The Attorney General’s third proffered justification is “because 

county jail treatment is intended to be an interim measure only, before 

transfer to state hospital.”

But as the court noted in Yang, based on the legislative history of 

section 4019, the Legislature’s impetus for extending competency treatment

to incompetent defendants housed in county jail facilities was to address “a 

longstanding problem with bed availability in state hospitals for treating 

[incompetent] defendants.” (Yang, supra, 78 Cal.App.5th at p. 137.) The Yang

court reasoned that: “Every defendant found incompetent to stand trial meets 

the same standard for commitment (§ 1367, subd. (a)), and the circumstance 

that an [incompetent] defendant may be committed to either a jail facility or 

a state hospital depending on the availability of a bed provides yet another 

reason to invalidate the challenged conduct credit disparities.” (Ibid.) We 

again agree with the analysis in Yang and reject the Attorney General’s third 

proffered justification.

The Attorney’s General’s fourth proffered justification is frankly 
13

difficult to understand. By way of background information, defendants who 

are convicted of serious felonies are generally limited to 15 percent conduct 

credits, meaning that they must effectively serve 85 percent of their total 

sentences. (§ 2933.1.) Section 2933.1’s limitation to conduct credits appears to 

apply to incompetent defendants while they are being treated in a county jail, 

but it does not appear to apply to incompetent defendants while they are 

being treated in a hospital. Based on this differential treatment of violent and 

nonviolent defendants under section 2933.1, the Attorney General argues, 

incompetent “defendants in appellant’s position who were subject to the 

section 2933.1 limitation would receive a windfall that their counterparts in 

county jail did not, thus justifying the Legislature not immediately extending 

the benefit.”

What is perplexing about the Attorney General’s argument is 

that Heimlich’s equal protection claim is plainly a facial challenge to section 

4019, and not a challenge to section 2933.1, or any other statute. Under the 

version of section 4019 as it existed from January 1, 2019, to December 31, 

2021, incompetent defendants were not able to earn conduct credits while 

they were being housed in state hospitals, regardless of whether they were 

later convicted of violent felonies or nonviolent felonies. In short, we fail to 

understand how the 15 percent credit limitation for defendants convicted of 

violent felonies under section 2933.1 has any bearing on our equal protection 

analysis of Heimlich’s facial challenge to the former version of section 4019. 

(See Yang, supra, 78 Cal.App.5th at p. 136 [“incentivizing good behavior 

appears equally reasonable and workable for defendants receiving 

competency treatment in a state hospital where patients with varying issues 

and/or criminal histories or proclivities are housed”].)

To conclude, we hold that the Legislature’s denial of conduct 
14

credits under section 4019 to incompetent defendants housed in state 

hospitals from January 1, 2019, to December 31, 2021, was not justified by 

any compelling governmental interests and therefore the law constituted a 

violation of the equal protection clause. (Accord, Yang, supra, 78 Cal.App.5th 

120; Shkrabak, supra, 89 Cal.App.5th 943.)

In this case, Heimlich was found incompetent to stand trial and 

he was housed in a state hospital for approximately two months during the 

relevant timeframe. And at the time of his sentencing hearing, the trial court 

denied Heimlich conduct credits under section 4019 while he was in the 

hospital. Thus, we find that Heimlich’s sentence was in violation of the equal 

protection clause. We remand this matter for an accurate determination of 

the number of credits Heimlich is entitled to during his presentence 

confinement at the county jail and at Atascadero State Hospital.

III.

DISPOSITION

Heimlich’s sentence is reversed; the matter is remanded. The 

trial court is directed to recalculate Heimlich’s presentence custody credits, 

and to award the number of conduct credits Heimlich is entitled to under 

section 4019. The court should prepare an amended abstract of judgment and 

forward it to the Department of Corrections.
15

In all other respects, the judgment is affirmed.

MOORE, ACTING P. J.

WE CONCUR:

SANCHEZ, J.

DELANEY, J.