Comment by sham1
Students do have rights - and indeed also property rights - here. Of course, when in class the students could be asked to bring their phones to the front and be given them back afterwards, but without the law, the use of phones couldn't be restricted during breaks etc. Thus the new law which can make the restrictions even more severe during school hours.
Students don't have many rights when it comes to what you can bring to or do at school. We were prohibited from wearing certain styles of clothes, hats, couldn't even chew gum in class. Pretty much anything that could be called disruptive, damaging, or dangerous was banned. I'm not sure how phones ever were considered acceptable in the first place. Even in the pre-smartphone days, SMS was a huge distraction.