You’re in for It Now, Boy
You can tell that the parent who texted the OP was a dad. This has “dad joke” written all over it. The dad texted his son, telling him that he was in huge trouble because he was texting while in class. The OP was only on his phone because the dad texted him in the first place!
But that might not be the case. After all, the son responded pretty quickly, as if he was already on his phone at the time. Let this be a lesson to everyone out there. If your parent texts you to tell you you’re in trouble, don’t believe it. If they really were mad, they would’ve waited until you got home.