www.un.org/Depts/DGACM/index_spanish.htm 在我的节目中,我测试了:。
try {
FileWriter mWriter = new FileWriter("/sys/class/leds/flashlight/brightness");
mWriter.write(125);
mWriter.flush();
} catch (Exception e) {
Log.e(TAG, "setFlashlightEnabled failed", e);
}
www.un.org/Depts/DGACM/index_spanish.htm 页: 1
01-13 14:56:30.578: E/test(603): setFlashlightEnabled failed
01-13 14:56:30.578: E/test(603): java.io.FileNotFoundException: /sys/class/leds/flashlight/brightness (Permission denied)
01-13 14:56:30.578: E/test(603): at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
01-13 14:56:30.578: E/test(603): at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
01-13 14:56:30.578: E/test(603): at java.io.FileOutputStream.<init>(FileOutputStream.java:94)
01-13 14:56:30.578: E/test(603): at java.io.FileOutputStream.<init>(FileOutputStream.java:66)
01-13 14:56:30.578: E/test(603): at java.io.FileWriter.<init>(FileWriter.java:80)
01-13 14:56:30.578: E/test(603): at sad.sdsa.sdjahskdhj.TestpuissanceActivity.onClick(TestpuissanceActivity.java:87)
01-13 14:56:30.578: E/test(603): at android.view.View.performClick(View.java)
01-13 14:56:30.578: E/test(603): at android.view.View$PerformClick.run(View.java)
01-13 14:56:30.578: E/test(603): at android.os.Handler.handleCallback(Handler.java)
01-13 14:56:30.578: E/test(603): at android.os.Handler.dispatchMessage(Handler.java)
01-13 14:56:30.578: E/test(603): at android.os.Looper.loop(Looper.java)
01-13 14:56:30.578: E/test(603): at android.app.ActivityThread.main(ActivityThread.java)
01-13 14:56:30.578: E/test(603): at java.lang.reflect.Method.invokeNative(Native Method)
01-13 14:56:30.578: E/test(603): at java.lang.reflect.Method.invoke(Method.java:507)
01-13 14:56:30.578: E/test(603): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
01-13 14:56:30.578: E/test(603): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
01-13 14:56:30.578: E/test(603): at dalvik.system.NativeStart.main(Native Method)
www.un.org/Depts/DGACM/index_spanish.htm 我在亚行进行了测试。 页: 1
echo 125 > /sys/class/leds/flashlight/brightness
它扎根,但并非正常。
What is the solution to change the flash output without being root?