echo 0 > /sys/class/leds/button-backlight/brightness
The above command is working perfectly through adb shell.But when I try to run through my code there is no effect.Here is my code.
Process mSuProcess;
mSuProcess = Runtime.getRuntime().exec("su");
DataOutputStream mSuDataOutputStream = new DataOutputStream(mSuProcess.getOutputStream());
mSuDataOutputStream.writeBytes("echo 0 > /sys/class/leds/button-backlight/brightness \n");
mSuDataOutputStream.flush();
mSuDataOutputStream.close();
Please help me out on this.
subinary usable for this purpose. See if you can manage to capture the stdout /stderr of the su process. Also consider installing something like connectbot and trying your commands in an interactive shell on the device, which will run as an application userid and thus give you a more comparable case than adb does.