This is not true of most chargers. It is true of some devices that they look for the data lines to have some voltage rather than be left floating. There are 6 different 'standards' for this so you end up needing an IC like this[1] to detect which one the device is using.
Note: USB-PD changes the game a huge amount. You do need to speak USB to upgrade power there. But I've yet to see USB-PD in the flesh.
[1]: http://www.ti.com/lit/ds/slvsby8b/slvsby8b.pdf