The phone uses signalling of numerous different types to figure out the capabilities.
Yep, have worked on that particular part of cellphones, and you're quite right. We also did "foldback" detection, which means that we monitor VUSB, and if we see it dropping, we start pulling less current, as we're probably overloading the supply. This is needed to deal with crappy DCP implementations (aka, chinese chargers).
We also backed off for a multitude of other reasons as well, mostly temperature-related.