Ofcourse its illegal. I don't really recall exact details as for that have to re-watch episode, you are talking about tyrell making out with that office boy.
Well, I just checked it for you, basically he was rooting the device and then has installed some kind of hidden app which uses a webserver or web service to send updates from this phone online where he can probably check it. That is the reason he is asked to activate thing.
Such things are available, you may search for child control / surveillance apps which lets parents to see where child is going, what he is texting and so on. I think this is the reason google has built in feature to "regularly" check for installed app's authenticity...it means if someone installed something in your phone without your knowledge then Google will inform you. (you can find that in under Settings in Android).