Tuesday, April 07, 2009

Android: Property System

http://letsgoustc.spaces.live.com/blog/cns!89AD27DFB5E249BA!438.entry

The property system using shared memory to save the property in the system. In system/core/init/init.c, initialize and start the property service:

property_init()
start_property_service() (in property_service.c)

In property_init(), creating the share memory space using ashmem_create_region(/dev/ashmem). The property service is a file socket(/dev/socket/property_service). In libcutils/properties.c define property_get()/property_set() function to set the property. It just send the command to socket and process it by property service(handle_property_set_fd()).

In the command line mode, you can use getprop/setprop.

No comments:

Related Posts Plugin for WordPress, Blogger...