When I was in high school (shortly before smartphones became widely available, but when feature phones definitely were), it was explicitly against the rules to use a cell phone in class. I believe that similar small electronic devices like iPods were also banned. The concern was actively using phones or other devices during class, rather than simply having them in your backpack or pocket, and also that if your cell phone ringer went off during class that would be distracting (which is in fact true, that is distracting).
My recollection is that some kids did try to violate the rule by surreptitiously texting during class, and did sometimes get their phones confiscated by a teacher; and also some people had their phones confiscated because they got a call or text and it went off in class, since they forgot to turn it off or silence the ringer (although sometimes kids were just asked to turn off the phone and didn't have it confiscated).
I personally was not particularly inclined towards rulebreaking (or was smart enough to only break rules I was sure I could get away with), and I wasn't the kind of social butterfly in high school who was constantly texting people anyway, so my own phone never got confiscated. Merely having phones (or other electronic devices) on your person during the school day and using them on campus but outside of class times (e.g. during lunch) wasn't against the rules. I specifically remember playing a lot of the Nokia phone snake game on my phone to pass time during lunch or while waiting to get picked up after school - because it was the only game on the phone that was even mildly interesting.
I think if my school had tried to ban having a cell phone on your person at all during the school day, I would've attempted to evade the ban by hiding it more deeply in my backpack or something. And if there were literal bag inspections in order to mitigate this, I would've been genuinely pretty angry about that and tried to think of something else I could do to evade the ban. Being compelled to put your phone in a locked box during the school day, rather than just silence it and not use it during class, seems very draconian to me.