Whenever it appears from the return of the writ, or otherwise, that the party is imprisoned on any criminal accusation, he or she shall not be discharged until sufficient notice shall have been given to the attorney general, or to the complainant in the matter, that he or she may appear and object to the discharge, if he or she think fit, which notice shall be given by the party imprisoned, in the manner prescribed by the court, or, in default thereof, he or she shall be remanded to the custody of the person against whom the writ of habeas corpus issued.
R.I. Gen. Laws § 10-9-16