To avoid doubt, this Subdivision does not apply where:
(a) a detainee in immigration detention voluntarily engages in an activity of a kind approved in writing by the Secretary for the purposes of this paragraph; or
(b) a prisoner in a prison or remand centre of the Commonwealth, a State or a Territory engages in an activity as a prisoner; or
(c) a person engages in an activity in compliance with:
(i) a sentence passed, or an order made, under subsection 20AB(1) of the Crimes Act 1914 (community service orders etc.); or
(ii) a community service order, a work order, a sentence of periodic detention, an attendance centre order, a sentence of weekend detention, an attendance order, or a similar sentence or order, passed or made under the law of a State or Territory.