In classrooms children shouldn't remove their phones from their pockets at all, they are there to focus on the class. If we removed our phones from our pockets, they would be confiscated until the end of class, and rightly so.
School is for paying attention and learning, not for going into your own little world on your phone (which we're all guilty of).
Also, the only time you need to use a computer at school is during IT lessons, or study/research sessions. School is the time that we learn and perfect our handwriting abilities, and our abilities to read through books, make notes based on what the teacher is saying, or writing on the blackboard, etc. It is not appropriate to pull out a laptop and use that instead, because that won't teach the child these important hand skills.
I'm talking about primary school and secondary school, and mostly college too. Once the student is 18 and begins university, there's nothing stopping them from using computers or phones, it's up to them to regulate their own attention and such.
I think that's all pretty reasonable and fair.