Hi Chih-Wei

The Sensor-HAL is used as a means to abstract the kernel/hardware level
details.

*sensors_control_open* lies in the control path of sensor HAL.
It is called by the sensor-service which runs as part of system_server.

* sensors_data_open* lies in the data path of sensor HAL.
It is called by every instance of sensor manager.

When any apk registers for sensor data, a copy of  sensors.so (HAL)
is attached to the process belonging to the apk.

NOTE: Even though it is a single file, there will be multiple instances of
sensors.so
during runtime. One for the sensor-service & one each for every app using
sensor.
Hence use of global variables to pass data between various functions
( _open, _activate, _poll etc. ) WILL fail.

Can you tell me what you are trying to achieve?


Regards
CVS


On Wed, Mar 23, 2011 at 9:55 AM, Chih-Wei <[email protected]> wrote:

> Hi Chinmay,
> I'm implementing a sensor HAL and facing
> some strange problems I didn't expect.
>
> I found the frameworks calls sensors_control_open
> once, but calls sensors_data_open multiple times.
> (when I open some apk, like Google Maps)
> That means my poll method is called by
> multiple instances of sensors_data_device_t.
> I don't understand why and how to handle
> such a situation to avoid conflict.
>
> Seems you are experienced in sensor HAL
> so I hope you can give me some hints.
> Thanks a lot!
>
>

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to