I never could figure out what the "SendData" Java code referred to. Maybe it's within the ServiceModeApp source. Anyway, sending the broadcast with the "am" command requires root, and the equivalent code in Java is:
Intent intent = new Intent("android.provider.Telephony.SECRET_CODE");
The app needs system (aka root) privileges so a normal app doesn't have a chance of calling this. I've used the RootTools library to give an app root privileges.
I normally don't beg for Thanks but I spent hours banging my head working this out. If this saves you some time spread the Thanks button love