Skip to content

Commit 79013bf

Browse files
committed
note update
1 parent 5496e52 commit 79013bf

4 files changed

Lines changed: 18 additions & 0 deletions

File tree

‎.DS_Store‎

0 Bytes
Binary file not shown.

‎_posts/2015-09-01-小米09月工作记录.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ tags : [工作,android,记录]
3434
![Binder机制4部分组件关系图](/img/Binder机制4部分组件关系图.gif)
3535

3636

37+
38+
>BnMediaPlayerService是一个Binder本地对象,它在内核中有一个对应的Binder实体对象,当另外一个进程要使用MediaPlayerService的时候,Binder驱动程序就会在内核创建一个Binder引用对象,同时在那个进程创建一个Binder代理对象,即一个BpMediaPlayerService对象。这四个对象是有一一对应关系的,因此,当一个进程调用BpMediaPlayerService对象的transact函数时,通过Binder驱动程序就可以找到对应的BnMediaPlayerService对象,并且调用它的OnTransact函数。
39+
40+
>接下去的while循环是通过sm->getService接口来不断尝试获得名称为“media.player”的Service,即MediaPlayerService。为什么要通过这无穷循环来得MediaPlayerService呢?因为这时候MediaPlayerService可能还没有启动起来,所以这里如果发现取回来的binder接口为NULL,就睡眠0.5秒,然后再尝试获取,这是获取Service接口的标准做法。 (**MiLinkService也是这么干的**)
41+
42+
3743
----
3844

3945
2015.09.06
@@ -93,3 +99,15 @@ tags : [工作,android,记录]
9399
![android_Touch事件分发机制](/img/android_Touch事件分发机制.png)
94100

95101

102+
`adb shell monkey -p com.zifei.on -v 500` 自动化测试,一阵狂跑。
103+
104+
105+
-----
106+
107+
108+
2015.09.07
109+
110+
[Binder机制中Client如何获得Server远程接口](http://blog.csdn.net/luoshengyang/article/details/6633311)
111+
112+
![BpMediaPlayerService类图](/img/BpMediaPlayerService类图.gif)
113+

‎img/.DS_Store‎

0 Bytes
Binary file not shown.

‎img/BpMediaPlayerService类图.gif‎

184 KB
Loading

0 commit comments

Comments
 (0)