34. Kernel Use case: Who calls ”onPause” in Activity? Activity queue 3:”onPause” is called in main thread 1:Call ”schedulePauseActivity” across process 2:Send message by Handler
39. Comparing binder with socket socket binder internal status associated to FD associated to PID (FD can be shared among threads in the same process) read & write operation as a stream done at once by ”ioctl” network transparency Yes No expects local only
41. Transaction of Binder (2) Process A Process B Binder Process A Binder Process B Copy memory by copy_from _user Copy memory by copy_to_user Then, wake up process B Process A and B have different memory space. They can not see each other. Kernel Kernel
58. Reading System Property Kernel init Other processes /dev/__properties__ (on tmpfs) mmap (read/write) mmap (read only) Just read the property in each process.
59. Writing System Property Kernel init Other processes /dev/__properties__ (on tmpfs) mmap (read/write) mmap (read only) Send write request to init through socket
60. Actual code of initialize System Properties fd = open ("/dev/__properties__", O_RDWR | O_CREAT, 0600); if (fd < 0) return -1; if ( ftruncate (fd, size) < 0) goto out; data = mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if(data == MAP_FAILED) goto out; close (fd); fd = open ("/dev/__properties__", O_RDONLY); if (fd < 0) return -1; unlink ("/dev/__properties__"); $(ANDROID_TOP)/system/core/init/property_service.c Give this fd to other processes. No longer access by file name. /dev is a tmpfs