What, you didn't know your smartphone had an "elevator mode?" OK, it's not as much of a "mode" as a state of being. A state of being in your pocket, preferably off.
We definitely don't want to be trapped in an elevator listening to one side of an extremely private phone conversation about what you will do to Sandra if she ever tries to pull that kind of crap again. (Well, most of us don't. Some will prick up their ears to learn more about Sandra's fate – not what you want, either.)
If you are on the phone when boarding an elevator, tell the other person you'll call them back in a second. Same thing if you get a phone call while riding the elevator. Texting, however, is perfectly acceptable, as long as you're not the Button Master. Duty calls!