(d) Notwithstanding any other provision of this subchapter, if a person is placed on deferred adjudication community supervision under Section 5, Article 42.12, Code of Criminal Procedure, subsequently receives a discharge and dismissal under 25 Section 5(c), Article 42.12, and satisfies the requirements of Subsection (e), the person may petition the court that placed the defendant on deferred adjudication for an order of nondisclosure under this subsection. Except as provided by Subsection (e), a person may petition the court under this subsection regardless of whether the person has been previously placed on deferred adjudication community supervision for another offense. After notice to the state and a hearing on whether the person is entitled to file the petition and issuance of the order is in the best interest of justice, the court shall issue an order prohibiting criminal justice agencies from disclosing to the public criminal history record information related to the offense giving rise to the deferred adjudication. A criminal justice agency may disclose criminal history record information that is the subject of the order only to other criminal justice agencies, for criminal justice or regulatory licensing purposes, an agency or entity listed in Subsection (i), or the person who is the subject of the order. A person may petition the court that placed the person on deferred adjudication for an order of nondisclosure on payment of a $28 fee to the clerk of the court in addition to any other fee that generally applies to the filing of a civil petition. The payment may be made only on or after:
(1) the discharge and dismissal, if the offense for which the person was placed on deferred adjudication was a misdemeanor other than a misdemeanor described by Subdivision (2);
(2) the second anniversary of the discharge and dismissal, if the offense for which the person was placed on deferred adjudication was a misdemeanor under Chapter 20, 21, 22, 25, 42, or 46, Penal Code; or
(3) the fifth anniversary of the discharge and dismissal, if the offense for which the person was placed on deferred adjudication was a felony.