随笔分类 -  binder

Parcel在binder通信readStrongBinder和writeStrongBinder
摘要:Binder IPC通信中,Binder是通信的媒介,Parcel是通信的內容。远程调用过程中,其参数都被打包成Parcel的形式来传递。 在IPC通信的Proxy端,我们经常可以看到下面类似的代码,一些参数都会打包到Parcel中。看下面的data和reply。 在IPC通信里,android是通 阅读全文
posted @ 2019-09-11 17:50 mingfeng002 阅读(3239) 评论(0) 推荐(0)
深入理解任何Binder Client都可以直接通过ServiceManager的0这个Binder句柄创建一个BpBinde
摘要:ServiceManager是安卓中一个重要的类,用于管理所有的系统服务,维护着系统服务和客户端的binder通信。对此陌生的可以先看系统服务与ServiceManager来了解应用层是如何使用ServiceManager的。我们可以通过 ServiceManager.getService(Stri 阅读全文
posted @ 2019-09-10 18:36 mingfeng002 阅读(932) 评论(0) 推荐(0)
Binder进程与线程ProcessState以及IPCThreadState
摘要:ProcessState以及IPCThreadState ProcessState是负责打开Binder节点并做mmap映射,IPCThreadState是负责与Binder驱动进行具体的命令交互。 ProcessState 实现ProcessState的主要关键点有以下几个: 保证同一进程只有一个 阅读全文
posted @ 2019-06-07 21:28 mingfeng002 阅读(3284) 评论(0) 推荐(0)
Binder的Native实现libbinder
摘要:libbinder – Binder的Native实现 出于性能和代码统一性的角度考虑,Binder IPC并不Java和Native环境里各实现一次,而只是分别在不同的执行环境里提供使用的接口。使用Binder的Java代码,通过一些使用Binder的Java类之后,必须会走入到Native环境, 阅读全文
posted @ 2019-06-07 19:41 mingfeng002 阅读(2913) 评论(0) 推荐(0)
Binder 驱动(三)
摘要:Binder 驱动是 Binder 的最终实现, ServiceManager 和 Client/Service 进程间通信最终都是由 Binder 驱动投递的。 Binder 驱动的代码位于 kernel 代码的 drivers/staging/android 目录下。主文件是 binder.h  阅读全文
posted @ 2019-04-12 18:31 mingfeng002 阅读(1139) 评论(0) 推荐(1)
Binder Native 层(二)
摘要:Binder 框架及 Native 层 Binder机制使本地对象可以像操作当前对象一样调用远程对象,可以使不同的进程间互相通信。Binder 使用 Client/Server 架构,客户端通过服务端代理,经过 Binder 驱动与服务端交互。 Binder 机制实现进程间通信的奥秘在于 kerne 阅读全文
posted @ 2019-04-12 18:30 mingfeng002 阅读(1307) 评论(0) 推荐(0)
android Binder机制(一)架构设计
摘要:Binder 被设计出来是解决 Android IPC(进程间通信) 问题的。Binder 将两个进程间交互的理解为 Client 向 Server 进行通信。 如下:binder总体架构图 如上图所示,Binder 架构分为 Client、Server、Service Manager 和 Bind 阅读全文
posted @ 2017-06-12 16:44 mingfeng002 阅读(1330) 评论(0) 推荐(0)