android - 任何人都可以向我描述一下 android 的 aidl 中的 oneway 是什么吗?

标签 android android-contentprovider aidl oneway

任何人都可以向我描述一下 Android 版 aidl 中的 oneway 是什么吗?

就像下面的代码一样,oneway 的作用是什么?

oneway interface IPackageStatsObserver {

    void onGetStatsCompleted(in PackageStats pStats, boolean succeeded);

}

最佳答案

摘自 Google 文档 ( https://developer.android.com/guide/components/aidl.html )

The oneway keyword modifies the behavior of remote calls. When used, a remote call does not block; it simply sends the transaction data and immediately returns. The implementation of the interface eventually receives this as a regular call from the Binder thread pool as a normal remote call. If oneway is used with a local call, there is no impact and the call is still synchronous.

关于android - 任何人都可以向我描述一下 android 的 aidl 中的 oneway 是什么吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41356713/

相关文章:

android - 自定义 ListView,其中所有图像都具有相同的大小

android - 多个dex文件定义android/support/annotation/AnimRes

android - 如何使用 ContentProvider 更新数据?

android - SQLiteConstraintException : error code 19: constraint failed -- Android error

android - 获取具有类型过滤功能的 Android 联系人,仅限于特定帐户

android AIDL 接口(interface)、parcelables 和向后兼容性

安卓联系人列表

java - Java 中的 Hex To String 性能太慢

java - 为什么 AIDL/Messenger 绑定(bind)到服务?