Seven. C + + implementation of the binder system's services
1. Writing code
Reference files:
Frameworks\av\include\media\imediaplayerservice.h (Imediaplayerservice,bnmediaplayerservice)
Frameworks\av\media\libmedia\imediaplayerservice.cpp (Bpmediaplayerservice)
Frameworks\av\media\libmediaplayerservice\mediaplayerservice.h
Frameworks\av\media\libmediaplayerservice\mediaplayerservice.cpp
Frameworks\av\media\mediaserver\main_mediaserver.cpp (server, AddService)
First time:
git clone https://github.com/weidongshan/APP_0004_Binder_CPP_App.git
Update:
Git pull origin
Remove the specified version:
git checkout v1//Initial release, not debugged
2. Compiling tests
Reference frameworks\av\media\mediaserver\android.mk
compile: A. File into Frameworks/testing//work/android-5.0. 2/ // Select Full_tiny4412-engc. cd frameworks/testing/App_0004_binder_cpp_ Appmmm.
Test:
A. Recompile the kernel and let IT support NFS
Make Menuconfig
<*> NFS Client Support | |
[*] NFS Client Support for NFS Version 3 | |
[*] NFS client Support for the NFSv3 ACL Protocol extension | |
[*] NFS Client Support for NFS version 4 | |
[*] NFS Client Support for NFSv4.1 (experimental)
Make zimage and use the new zimage to start the veneer
B. Mount NFS
Su
Ifconfig eth0 192.168.1.100
BusyBox mount-t nfs-o nolock,vers=2 192.168.1.123:/work/nfs_root/mnt
C. Implementation of Test_server, test_client
./test_server &
Logcat helloservice:* *:s &
./test_client Hello
./test_client Hello Weidongshan
Note If you are using the kernel of the previous section, you have modified the BINDER.C, which contains the printed information. Should revert to the original, otherwise startup is very slow.
Makeflie:
7th Lesson 2nd Section _binder System _c++ Implementation _ compile test