Getting off your phone to be able to talk to the cashier is obviously the right thing to do but I don't think forcing somebody off their phone is the right way around it. When somebody is rude in other situations you don't say "Sorry, but this is how you should be acting" instead you, and everyone around you, thinks "what a prick". As an example, a couple days ago a man with a pushchair was trying to get through a day so a woman nearby opened it for him and let him in. The man so much as look at her to acknowledge her existence let alone say thank you. The woman didn't stop everything and force him to say thank you because it wouldn't mean anything at that point anyway and instead glared at him and probably thought "what a prick!"|
In the situation of being on the phone as I'm about to be served I would try to end the conversation, with an "I'll call you back in a minute" if necessary, but if I couldn't for whatever reason I'd smile at the cashier and say something along the lines of "Hello! Sorry, but I need to take this". I don't see why I should be denied service because of that. I can accept that I'd be disliked for it, which is why I'd try to stop it in the first place but obviously the call is important enough for me to not mind. Putting myself in the place of the cashier, I don't think I would mind either, I wouldn't like it particularly but I could deal with it.
On the flipside I hate it when somebody serving you talks to somebody else, either a colleague or someone else in the store, the whole time but I wouldn't force them to stop their conversation to serve me. I've had it before where the cashier (not at a supermarket) only ever told me how much I needed to pay and said nothing else nor gave any eye contact throughout the whole transaction. I thought they were rude, payed for my things and walked away.
In a nutshell, it is rude but people have the right to be rude and we have the right to hate them for it.
XBL/ PSN/ Steam/ NNID - MatMan562