52. system 979 328 system_server
root 328 1 zygote
media 331 1 /system/bin/mediaserver
system 316 1 /system/bin/servicemanager
53. system 979 328 system_server
root 328 1 zygote
media 331 1 /system/bin/mediaserver
system 316 1 /system/bin/servicemanager
Most of the Java services live in here
54. system 979 328 system_server
root 328 1 zygote
media 331 1 /system/bin/mediaserver
system 316 1 /system/bin/servicemanager
Most of the Java services live in here
One of native services
58. • Still need kernel’s help
• Heavily object oriented
• Put “transmission part” and “logic part” together
59. • Still need kernel’s help
• Heavily object oriented
• Put “transmission part” and “logic part” together
(Interface, Inheritance…etc)
60. • Still need kernel’s help
• Heavily object oriented
• Put “transmission part” and “logic part” together
(Inheritance)
(Interface, Inheritance…etc)
88. $ cd ${AOSP_ROOT}/frameworks/native/libs/binder
$ mma
$ ls ${AOSP_ROOT}/out/target/product/${DEVICE}
system/lib
> libbinder.so libutils.so libcutils.so . . . .
Binder module’s dir
Build binder module and its dependencies
89. $ cd ${AOSP_ROOT}/frameworks/native/libs/binder
$ mma
$ ls ${AOSP_ROOT}/out/target/product/${DEVICE}
system/lib
> libbinder.so libutils.so libcutils.so . . . .
Binder module’s dir
Build binder module and its dependencies
90. $ cd ${AOSP_ROOT}/frameworks/native/libs/binder
$ mma
$ ls ${AOSP_ROOT}/out/target/product/${DEVICE}
system/lib
> libbinder.so libutils.so libcutils.so . . . .
Binder module’s dir
Build binder module and its dependencies
Result libraries
91. PART OF ANDROID.MK
LOCAL_MODULE := myVibrator
LOCAL_C_INCLUDES += $(AOSP_INCLUDE)
LOCAL_LDLIBS += -L$(AOSP_LIB)
LOCAL_LDLIBS += -llog -lbinder -lutils -lcutils
92. PART OF ANDROID.MK
LOCAL_MODULE := myVibrator
LOCAL_C_INCLUDES += $(AOSP_INCLUDE)
LOCAL_LDLIBS += -L$(AOSP_LIB)
LOCAL_LDLIBS += -llog -lbinder -lutils -lcutils
93. PART OF ANDROID.MK
LOCAL_MODULE := myVibrator
LOCAL_C_INCLUDES += $(AOSP_INCLUDE)
LOCAL_LDLIBS += -L$(AOSP_LIB)
LOCAL_LDLIBS += -llog -lbinder -lutils -lcutils
94. PART OF ANDROID.MK
LOCAL_MODULE := myVibrator
LOCAL_C_INCLUDES += $(AOSP_INCLUDE)
LOCAL_LDLIBS += -L$(AOSP_LIB)
LOCAL_LDLIBS += -llog -lbinder -lutils -lcutils
104. class BpMyVibrator : public BpInterface<IMyVibrator> {
virtual bool hasVibrator(void) {…}
virtual void vibrate(int32_t, String16&, int64_t,
int32_t, sp<IBinder>&) {…}
virtual void cancelVibrate(sp<IBinder>& token) {…}
(vibratePattern Omitted)
}
Same interface in IVibratorService.aidl
105. About detailed Binder part in this example…
http://mshockwave.blogspot.tw/2015/01/using-binder-to-vibrate-android-
binder.html
http://mshockwave.blogspot.tw/2015/02/using-binder-to-vibrate-android-
binder.html