I don't have SE phone, but I've looked into its system dump and:
- In AOSP sources there are two internal methods in com.android.internal.telephony interface: enableDataConnectivity() and disableDataConnectivity(). This interface and its implementation is a part of the system.
- There are also two methods with same names as above in com.android.phone.PhoneInterfaceManager which is a part of Phone.apk app. These methods just call above/system ones.
- Sony modified com.android.phone.PhoneInterfaceManager.enableDataConnectivity(), so it does additional check for boolean stored in sharedPreferences. If it's false, then enableDataConnectivity() method always calls disableDataConnectivity() of com.android.internal.telephony .
- Of course this boolean is controlled through preferences screen: "MMS & data". It's stored in "com.android.phone_preferences" preferences container and pref key is: "data_service_key". Additionally when you switch this checkbox, settings activity automatically calls methods from com.android.internal.telephony to switch data state immediately.
If you want to add data connection widget or something like that to your rom, then:
- You need root.
- You need "android.uid.phone" sharedUserId to access above settings.
I think it would be best to modify Phone.apk, so it will catch special intent to enable/disable data. It would set data_service_key boolean and call one of methods from com.android.internal.telephony. This should be quite easy thing to do and then you will be able to create widgets, apps and other stuff very easily - they would use that special intent.