diff options
| author | 2021-10-15 11:02:03 -0700 | |
|---|---|---|
| committer | 2021-10-18 17:12:23 +0000 | |
| commit | 96174ac484caa39b7363089c0494a1b6be620cb3 (patch) | |
| tree | 90bf4a8e893ea9a4e183bc7c23292f5cfb1fc233 | |
| parent | 1dbd7a49ccc38c14d5268c562a14b5b0ba898af5 (diff) | |
Add AIBinder_setMinSchedulerPolicy
Add setMinSchedulerPolicy on AIBinder to be equivalent to the HIDL one.
Test: build
Bug: 203207604
Change-Id: Ifd02ae24d319c365fae85d11496a1017876bd3ba
| -rw-r--r-- | libs/binder/ndk/ibinder.cpp | 4 | ||||
| -rw-r--r-- | libs/binder/ndk/include_platform/android/binder_ibinder_platform.h | 13 | ||||
| -rw-r--r-- | libs/binder/ndk/libbinder_ndk.map.txt | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/libs/binder/ndk/ibinder.cpp b/libs/binder/ndk/ibinder.cpp index 49c7b7cc08..81aa551dac 100644 --- a/libs/binder/ndk/ibinder.cpp +++ b/libs/binder/ndk/ibinder.cpp @@ -780,3 +780,7 @@ AIBinder* AIBinder_fromPlatformBinder(const android::sp<android::IBinder>& binde AIBinder_incStrong(ndkBinder.get()); return ndkBinder.get(); } + +void AIBinder_setMinSchedulerPolicy(AIBinder* binder, int policy, int priority) { + binder->asABBinder()->setMinSchedulerPolicy(policy, priority); +} diff --git a/libs/binder/ndk/include_platform/android/binder_ibinder_platform.h b/libs/binder/ndk/include_platform/android/binder_ibinder_platform.h index e315c798ee..b0217c4efc 100644 --- a/libs/binder/ndk/include_platform/android/binder_ibinder_platform.h +++ b/libs/binder/ndk/include_platform/android/binder_ibinder_platform.h @@ -55,4 +55,17 @@ __attribute__((weak)) void AIBinder_setRequestingSid(AIBinder* binder, bool requ */ __attribute__((weak, warn_unused_result)) const char* AIBinder_getCallingSid() __INTRODUCED_IN(31); +/** + * Sets a minimum scheduler policy for all transactions coming into this + * AIBinder. + * + * This must be called before the object is sent to another process. + * Aborts on invalid values. Not thread safe. + * + * \param binder local server binder to set the policy for + * \param policy scheduler policy as defined in linux UAPI + * \param priority priority. [-20..19] for SCHED_NORMAL, [1..99] for RT + */ +void AIBinder_setMinSchedulerPolicy(AIBinder* binder, int policy, int priority) __INTRODUCED_IN(33); + __END_DECLS diff --git a/libs/binder/ndk/libbinder_ndk.map.txt b/libs/binder/ndk/libbinder_ndk.map.txt index 8605686740..64170af6fc 100644 --- a/libs/binder/ndk/libbinder_ndk.map.txt +++ b/libs/binder/ndk/libbinder_ndk.map.txt @@ -145,6 +145,7 @@ LIBBINDER_NDK33 { # introduced=33 global: AIBinder_Class_disableInterfaceTokenHeader; AIBinder_DeathRecipient_setOnUnlinked; + AIBinder_setMinSchedulerPolicy; # llndk AParcel_marshal; AParcel_unmarshal; }; |