Following on from noise and communication theory...
If there was an email that was just a little thing that said "I am thinking of you", and you knew it was either sent by them OR there was a 50% chance it had been send randomly by a robot -- what could you assume then? You wouldn't be able to say with full certainly that the sender was actually thinking of you.
The same is true with someone glancing at you -- were they actually looking at you, or were they just looking up and you happened to be in the way?
This uncertainty releases you from the obligation to look straight back and acknowledge them. How? Because the following holds true if they didn't mean to look at you:
This is all implicature, and the shared understanding of the potential communication example means you should avoid situations which could annoy people.
(The exchange above could be seen in transactional analysis as a game to trick people out of strokes. It's a rude thing to do, and won't breed goodwill in the long run: you're forcing a person into a role.)
Software could be designed to: