Where a person held in custody on a charge of an offence of which the person has not been convicted appears or is brought before a court empowered by section 8 to grant bail to the person in relation to that offence, the court shall, subject to this Act, grant bail to that person or enlarge or vary bail already granted to the person in relation to that offence.