A man has been charged following a dramatic siege in Sydney’s west that left a police officer injured and a woman trapped inside a home.