I am not a teacher, but what about actually give them the freedom to use it when the feel like using?
The ones not paying attention will likely not perform well but, wouldn’t a lesson be thought to them when some realize that using the phone in the class leads to poor results.
Like I said, I am not a teacher, so my comment might be full of flaws.