Set minimum scheduling policy for a service.
When creating a binder service object.
Bug: 37293077
Test: hidl_test
Change-Id: Ibfdd6aa3106200d1c4f0591b7dd3c3cc1185f413
diff --git a/generateCpp.cpp b/generateCpp.cpp
index 44c785b..a3f7577 100644
--- a/generateCpp.cpp
+++ b/generateCpp.cpp
@@ -1468,6 +1468,10 @@
<< "\") { \n";
out.indent();
out << "_hidl_mImpl = _hidl_impl;\n";
+ out << "auto prio = ::android::hardware::details::gServicePrioMap.get("
+ << "_hidl_impl, {SCHED_NORMAL, 0});\n";
+ out << "mSchedPolicy = prio.sched_policy;\n";
+ out << "mSchedPriority = prio.prio;\n";
out.unindent();
out.unindent();