Perhaps worth reading :
https://www.maximintegrated.com/en/a....mvp/id/4803#5 and in particular looking at the diagram at
https://www.maximintegrated.com/en/i.../4803Fig04.gif which shows how a portable device should be able to detect if it connected to a "Dedicated Charging Port".
BobC