Binder

2022-04-20  本文已影响0人  ttyttytty

AIDL
1.流向

   Book addBookIn(in Book book);
   Book addBookOut(out Book book);
   Book addBookInout(inout Book book);

2.传递类型

   Another  implements Parcelable ;
   private List<Another> anothers;   
   anothers = in.createTypedArrayList(Another.CREATOR);  
   dest.writeTypedList(anothers);
   private Map<String, float[]> channelDataMap=new HashMap<>();   
   in.readMap(channelDataMap, getClass().getClassLoader());   
   dest.writeMap(channelDataMap);
   Another  implements Parcelable ;
   private Another another; 
   another = in.readParcelable(Another.class.getClassLoader());   
   dest.writeParcelable(another,0);

传递类型

3.AIDL的兼容性:插件A使用Data:1,插件B使用Data_V2;ResearchApp本身Data_V3; 如何保证正常AIDL通信?
—— 不修改已对外公布的接口定义。

4.每一个AIDL接口都是子线程。只有Binder里面的代码才是在(Binder进程)跑,其他外围代码都在调用进程跑;同时,不同的queryBinder是在主线程,其他都是在Research_data的不同线程

上一篇 下一篇

猜你喜欢

热点阅读