Pls check permission of /sys/class/leds/red/brightness. If it is world writable than forget about above files. Write your own Java + Jni wrapper which simply writes to appropriated locations. If it is only accessible to certain group than probably give $service list. You may get interface name corresponding to LedService, which you can use by reflection if you know correct API. Hope it will help you.
On Tuesday, December 31, 2013 10:16:09 AM UTC+5:30, Dharanija Thatham wrote: > > Hi, > I have been trying to control the LED on an android phone. I can make the > led blink by directly accessing the /sys/class/leds/red/brightness present > in the phone using adb shell. But I am having difficulty in making the > android talk to the led. I happen to come across this link online: > > https://android.googlesource.com/platform/hardware/libhardware.git/+/0100d517b1118ec181cf20e8648f3416b0830088%5E > I think that the C files in the 'led' folder and the led.h in the > 'include' folder are necessary to expose the /sys/class location. But I > also need the *com_android_server_LedService.cpp* and *LedService.java *files > for the java interface and to call the function opening the /sys/class > location. Kindly correct me if I am wrong. > > My problem is that I am unable to find the .cpp and.java files mentioned > above. Any help/guidance in this issue is very much appreciated. > > > Thanks. > Dharanija > -- -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting --- You received this message because you are subscribed to the Google Groups "android-porting" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-porting+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.