任何人都可以向我描述一下 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/