On another platform we devised a sysprop mechanism for the app to change some things. In our init.project.rc we added some on property code like below:
on property:usb.mydevice=1
#do something
I call this from app code like this:
Process proc = Runtime.getRuntime().exec(new String[] {"/system/bin/setprop",“usb.mydevice”,“1”});
And I get the following output:
setprop: failed to set property ‘usb.mydevice’ to ‘1’