为什么通过AIDL方式使用binder机制的时候如果Bn端函数比较耗时Bp端会ANR
来源:互联网 发布:编写网站的软件 编辑:程序博客网 时间:2024/05/20 13:36
分析:
看源码红色部分,第三个参数是0,而FLAG_ONEWAY = 0x00000001;(可以添加oneway来设置它)
private static class Proxy implements com.example.abc.ITest {
private android.os.IBinder mRemote;
.....................
@Override
public int add(int a, int b) throws android.os.RemoteException {
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
int _result;
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeInt(a);
_data.writeInt(b);
mRemote.transact(Stub.TRANSACTION_add, _data, _reply, 0);
_reply.readException();
_result = _reply.readInt();
} finally {
_reply.recycle();
_data.recycle();
}
return _result;
}
}
static final int TRANSACTION_add = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
}
- 为什么通过AIDL方式使用binder机制的时候如果Bn端函数比较耗时Bp端会ANR
- android binder机制中的BN跟BP
- 通过 AIDL 分析 Binder 的工作机制
- 使用AIDL分析Binder的工作机制
- android binder机制Bp端对象理解
- AndroidFramework -- Binder中的Bn与Bp
- AIDL使用和Binder机制详解
- AIDL下Binder的工作机制
- MediaPlayer.cpp中mplayer是bp还是bn端呢?
- Binder机制和AIDL
- AIDL 与 Binder机制
- android 中Bn 和Bp的区别
- android 中Bn 和Bp的区别
- 5.2 绑定服务的三种方式:扩展 Binder 类、使用 Messenger、使用 AIDL
- Binder 框架(二)aidl的使用
- Binder框架 -- android AIDL 的使用
- Android为什么使用Binder作为IPC机制
- Android中Binder机制理解及AIDL使用基本步骤
- 自定义BaseRecyclerAdapter适配器
- mybatis 配置-简单记录一下,免得忘记了
- 【职场经历】-找工作
- zabbix 添加jvm监控
- spark笔记
- 为什么通过AIDL方式使用binder机制的时候如果Bn端函数比较耗时Bp端会ANR
- vfork函数
- 史上最全的开源库整理
- uva 10194 Football(sort排序)
- JAVA代码实现远程服务器的文件操作
- css3中的display:-webkit-box的用法
- 内存分配中堆和栈的区别
- java厚积薄发之unicode与utf-8的区别
- Unity 技能冷却使用的两种倒计时