Hi ,
I needed to add  a daemon written in C to AOSP start up. Basically it needs 
to read and write to some sysfs files and also enable/disable airplane mode 
based on a button press. I get button events from linux input key events( 
/dev/input/event1 ) and enable airplane mode using the command "settings 
put global airplane_mode_on 1" in my C code. The code is in "external" 
directory and I have added below snippet in 
device/qcom/msm8996/init.target.rc.

service myapp /system/bin/myapp
    class main
    user root
    group system wakelock

on property:sys.boot_completed=1
    start hotswapd

I am a linux kernel guy and not much into AOSP customization. I am 
struggling with sepolicy issues. If anyone could answer below queries, I 
would greatly appreciate it.

1. Is this the right way to add a daemon?
2. What are the exact steps to get this daemon to run with all required 
permissions at start up?
3. What happens if this daemon is killed? Will it be restarted by android?
4. Am I enabling airplane mode in the right way? Is there a better/cleaner 
way of doing it?

Thanks

Rohith

-- 
-- 
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/d/optout.

Reply via email to