sm6375-common: power-libperfmgr: Add minimal binder thread prio as -20 to match process prio

Bug: 227811781
Test: Build
Change-Id: I94670429ede032703661ee8eb8b1ea6456f5cbd5
Signed-off-by: Wei Wang <wvw@google.com>
This commit is contained in:
Wei Wang 2024-07-18 20:16:00 +05:30 committed by Anand S
parent 938e2b96f7
commit 454a949b18
No known key found for this signature in database
GPG key ID: 3B2983FA448B3D61

View file

@ -18,6 +18,7 @@
#include <android-base/logging.h> #include <android-base/logging.h>
#include <android-base/properties.h> #include <android-base/properties.h>
#include <android/binder_ibinder_platform.h>
#include <android/binder_manager.h> #include <android/binder_manager.h>
#include <android/binder_process.h> #include <android/binder_process.h>
#include <perfmgr/HintManager.h> #include <perfmgr/HintManager.h>
@ -49,9 +50,12 @@ int main() {
// core service // core service
std::shared_ptr<Power> pw = ndk::SharedRefBase::make<Power>(); std::shared_ptr<Power> pw = ndk::SharedRefBase::make<Power>();
ndk::SpAIBinder pwBinder = pw->asBinder(); ndk::SpAIBinder pwBinder = pw->asBinder();
AIBinder_setMinSchedulerPolicy(pwBinder.get(), SCHED_NORMAL, -20);
// extension service // extension service
std::shared_ptr<PowerExt> pwExt = ndk::SharedRefBase::make<PowerExt>(); std::shared_ptr<PowerExt> pwExt = ndk::SharedRefBase::make<PowerExt>();
auto pwExtBinder = pwExt->asBinder();
AIBinder_setMinSchedulerPolicy(pwExtBinder.get(), SCHED_NORMAL, -20);
// attach the extension to the same binder we will be registering // attach the extension to the same binder we will be registering
CHECK(STATUS_OK == AIBinder_setExtension(pwBinder.get(), pwExt->asBinder().get())); CHECK(STATUS_OK == AIBinder_setExtension(pwBinder.get(), pwExt->asBinder().get()));