If the defendant's motion to return property or suppress evidence is granted and the people file a petition for writ of mandate or prohibition pursuant to subdivision (o) or a notice of intention to file a petition, the defendant shall be released pursuant to Section 1318, unless (1) he or she is charged with a capital offense in a case where the proof is evident and the presumption great, or (2) he or she is charged with a noncapital offense defined in Chapter 1 (commencing with Section 187) of Title 8 of Part 1, and the court orders that the defendant be discharged from actual custody upon bail.
Ca. Pen. Code § 1538.5