This is really annoying. I don't often walk among strangers, though, so it's not a big problem for me.
One solution, though not fail-proof, is to see if they are looking at you. If a stranger is going to say hello to you, it is highly likely that they will try to make eye-contact with you. Of course, the person on the phone may too, just to see what you're up to, or as a silent greeting.
If anyone else has a better idea, please do tell.
_________________
Your grammar makes me [sic].
...[T]here's nothing in the world more unpredictable than people...logic and order don't really exist in human emotions.
--Jan Hartman