But every time someone does randomly talk to me, I smile and laugh and I'm very cordial. Because people who approach strangers generally get quite angry when they're outright shot down. That doesn't at all mean I'm happy to talk. A smile is often just a defensive response.
If a stranger bothers me while I have my headphones on I may act friendly and polite, but I am actually very irritated.
"Sorry mate, I'm reading" is hardly difficult.
Also reading something would be a clear signal (also to me) that a person doesn't want to get disturbed.
When I have to tell you that I don't want to talk, you have already disturbed me. So, taking the cues here clearly is on you, not on me, at least in my opinion.
Edit: To clarify a bit, I'm talking about places with involuntary social contact, like for example a train or a grocery store. I go on a train because I have to get somewhere, not because I want to interact with people. It would be a different scenario say in a bar.