I want to add my own framework code that runs in the Android \"system_server\" (handles all the system level services). My service loads a JNI library that talks to a driver
Follow the below steps for writing your own System Service in android framework.
PS; if your service get some fatal exception, device will soft reboot, as your service is running under system service.