I think you have serveral choices, also depending on the android version you are using...
For my experience in porting eclair (2.1) there are three ways to access hardware: - directly from an application, over a shared library - using the HAL -> old one: "hardware/libhardware_legacy" -> which is principially equal to access it directly - using the HAL -> the new one: "hardware/libhardware" -> you have to create a stub, which implement the HAL-interface "hardware.h" For a proper integration it is recommended to use the HAL. For integrate it into the framework, there are also different ways: I think the best way for a complete integration is to create a new hardware service with a service and manager component. Therefore you have to create the ThermalService: java: frameworks/base/services/java/com/android/server/ThermalService.java native: frameworks/base/services/jni/com_android_server_ThermalService.java frameworks/base/services/jni/Android.mk Then you have to populate it the framework: You need an AIDL-Interface for this Service at: frameworks/base/core/java/android/os/ThermalService.aidl frameworks/base/Android.mk For completeness you can write a manager, which encapsulates the IPC, so any application can use the ThermalService like a local object over an manager instance: frameworks/base/core/java/android/os/ThermalManager.java Finally you can make your Service automatically start by the SystemServer: frameworks/base/services/java/com/android/server/SystemServer.java For more details look at the existing Services, like HardwareService. Greetz Dudero On 8 Apr., 09:22, Srinidhi K V <[email protected]> wrote: > Hi, > > I have a Thermal management code written in C for a custom EVM board. I want > to add this as a module (make part of Android). How do i do that? Any > pointers will be of great help. > > Thanks > Srinidhi -- unsubscribe: [email protected] website: http://groups.google.com/group/android-porting
