My kid's HS allows them to listen to music during study hall and at their teacher's discretion in class.
Both kids have shown me how they get away with listening to music in class when they're not supposed to. Thread the earbud through a hoodie sleeve, place it in your ear, and then lean that ear on your closed fist on the desk. The preferred method for boys seems to be just straight up pulling up their hoodie hood and threading them around the back of their ears.
I've done my required parental warnings and frowning over the practice, but when I was in HS, I'd work crossword puzzles instead of taking notes. Or I'd photocopy a chapter of a novel and read that instead of the required textbook reading in class. Kids will be kids blah blah blah.