Brazilian students returned to class this week with a new task: staying away from their smartphones under a new law restricting the use of devices in schools.