+constexpr const char DEST_PROCESS_NAME[] = "pkgmgr-info";
+
+PkgInfoClient::CPUInheritanceInvoker::CPUInheritanceInvoker()
+ : set_complete_(false) {}
+
+PkgInfoClient::CPUInheritanceInvoker::~CPUInheritanceInvoker() {
+ ClearCPUInheritance();
+}
+
+void PkgInfoClient::CPUInheritanceInvoker::SetCPUInheritance() {
+ int ret = resource_set_cpu_inheritance(gettid(), DEST_PROCESS_NAME, -1);
+ if (ret != 0) {
+ LOG(ERROR) << "set cpu inheritance fail ret : " << ret;
+ return;
+ }
+
+ set_complete_ = true;
+}
+
+void PkgInfoClient::CPUInheritanceInvoker::ClearCPUInheritance() {
+ if (!set_complete_)
+ return;
+
+ int ret = resource_clear_cpu_inheritance(gettid(), DEST_PROCESS_NAME);
+ if (ret != 0) {
+ LOG(ERROR) << "clear cpu inheritance fail ret : " << ret;
+ return;
+ }
+
+ set_complete_ = false;
+}