본문 바로가기
Programming/Android Kernel,Native

Android IPC Mechanism

by 개Foot/Dog발?! 2014. 10. 21.

URL : http://www.slideshare.net/jserv/android-ipc-mechanism


.....


(0) IPC: The heart of Android

(1) Design Patterns

(2) Binder IPC Internals

(3) Use case: Graphics


Binder IPC: The heart of Android


Android Tasks

Component View


Why IPC?


• Each process has its own address space

• Provides data isolation

• Prevents harmful direct interaction between two 

different processes

– Sometimes, communication between processes is required for modularization


IPC Mechanisms

• In GNU/Linux

– Signal

– Pipe

– Socket

– Semaphore

– Message queue

– Shared memory

• In Android

– Binder: lightweight RPC (Remote Procedure Communication) mechanism


.....



Design Patterns


.....


Design Patterns used in Binder (incomplete)

• Proxy Pattern

• Mediator Pattern

• Bridge Pattern


.....


.....



.....


.....



Binder Internals


Binder Terminology

Binder

• Binder Object

– an instance of a class that implements the Binder interface.

– One Binder object can implement multiple Binders

• Binder Protocol

• IBinder Interface

– is a well-defined set of methods, properties and events that a Binder can implement.

• Binder Token

– A numeric value that uniquely identifies a Binder


Facilities

Simple inter process messaging system

• Managing

• Identifying

• Calls

• Notification

• Binder as a security access token


.....



Get Service list from SM

$ adb shell service list

Found 71 services:

0 stub_isms: [com.android.internal.telephony.ISms]

1 stub_phone: [com.android.internal.telephony.ITelephony]

2 stub_iphonesubinfo: [com.android.internal.telephony.IPhoneSubInfo]

..

5 stub_telephony.registry: [com.android.internal.telephony.ITelephonyRegistry]

...

7 stub_activity: [android.app.IActivityManager]

...

9 phone: [com.android.internal.telephony.ITelephony]

56 activity: [android.app.IActivityManager]

...

64 SurfaceFlinger: [android.ui.ISurfaceComposer]





......


android-binder-120321103105-phpapp01.pdf