diff --git a/frameworks/core/frame_aware_policy/include/intellisense_server.h b/frameworks/core/frame_aware_policy/include/intellisense_server.h index 7fbbe96d4ebd9f699b45e81b889bf6eb50c1e648..ed01efe679ca013ceea738bd37ff842bce045b9f 100644 --- a/frameworks/core/frame_aware_policy/include/intellisense_server.h +++ b/frameworks/core/frame_aware_policy/include/intellisense_server.h @@ -49,9 +49,9 @@ private: void NewBackground(int pid); void NewDiedProcess(int pid); void NewAppRecord(int pid, int uid); - void AuthAppKilled(int uid); - void AuthForeground(int uid); - void AuthBackground(int uid); + void AuthAppKilled(int pid); + void AuthForeground(int pid); + void AuthBackground(int pid); int TryCreateRtgForApp(AppInfo *app); int CreateNewRtgGrp(int prioType = 0, int rtNum = 0); inline CgroupPolicy CheckCgroupState(const CgroupPolicy cgroup); diff --git a/frameworks/core/frame_aware_policy/src/intellisense_server.cpp b/frameworks/core/frame_aware_policy/src/intellisense_server.cpp index 699ceabdbaaa2240d21e415db142231bc121b852..5abca731df56e2daaa84a2937b90f66cba3ec41e 100644 --- a/frameworks/core/frame_aware_policy/src/intellisense_server.cpp +++ b/frameworks/core/frame_aware_policy/src/intellisense_server.cpp @@ -284,11 +284,11 @@ void IntelliSenseServer::ReportCgroupChange(const int pid, const int uid, const if (newState == CgroupPolicy::SP_BACKGROUND) { RME_LOGI("CgroupChange NewBackground"); NewBackground(pid); - AuthBackground(uid); + AuthBackground(pid); } else if (newState == CgroupPolicy::SP_FOREGROUND) { RME_LOGI("web test CgroupChange NewForeground uid is %{public}d", uid); NewForeground(pid, uid); - AuthForeground(uid); + AuthForeground(pid); } } @@ -298,7 +298,7 @@ void IntelliSenseServer::ReportAppInfo(const int pid, const int uid, const std:: return; } if (state == ThreadState::CREATE) { - AuthForeground(uid); + AuthForeground(pid); } RME_LOGI("Get app info:%{public}d %{public}d %{public}s %{public}d", pid, uid, bundleName.c_str(), static_cast(state)); @@ -320,7 +320,7 @@ void IntelliSenseServer::ReportProcessInfo(const int pid, switch (state) { case ThreadState::DIED: RME_LOGI("ProcessInfo NewDiedProcess"); - AuthAppKilled(uid); + AuthAppKilled(pid); NewDiedProcess(pid); break; case ThreadState::CREATE: @@ -345,35 +345,35 @@ void IntelliSenseServer::SetPara(const int32_t currentFps, const int32_t current RME_LOGI("[SetPara]:subEventPara map size: %{public}zu", tempMap.size()); } -void IntelliSenseServer::AuthAppKilled(int uid) +void IntelliSenseServer::AuthAppKilled(int pid) { - int ret = AuthDelete(uid); + int ret = AuthDelete(pid); if (ret == 0) { - RME_LOGI("auth_delete %{public}d success", uid); + RME_LOGI("auth_delete %{public}d success", pid); } else { - RME_LOGE("auth_delete %{public}d failed", uid); + RME_LOGE("auth_delete %{public}d failed", pid); } } -void IntelliSenseServer::AuthForeground(int uid) +void IntelliSenseServer::AuthForeground(int pid) { unsigned int flag = AF_RTG_ALL; int status = AUTH_STATUS_FOREGROUND; - int ret = AuthEnable(uid, flag, status); + int ret = AuthEnable(pid, flag, status); if (ret == 0) { - RME_LOGI("auth_enable %{public}d success", uid); + RME_LOGI("auth_enable %{public}d success", pid); } else { - RME_LOGE("auth_enable %{public}d failed", uid); + RME_LOGE("auth_enable %{public}d failed", pid); } } -void IntelliSenseServer::AuthBackground(int uid) +void IntelliSenseServer::AuthBackground(int pid) { - int ret = AuthPause(uid); + int ret = AuthPause(pid); if (ret == 0) { - RME_LOGI("auth_pause %{public}d success", uid); + RME_LOGI("auth_pause %{public}d success", pid); } else { - RME_LOGE("auth_pause %{public}d failed", uid); + RME_LOGE("auth_pause %{public}d failed", pid); } } diff --git a/qos_manager/include/qos_common.h b/qos_manager/include/qos_common.h index 671bf5cc5296ff184e683ae7e40c01b2f9be197d..c99f96cbec84fc9ea2282dd51f42d66c3154522e 100644 --- a/qos_manager/include/qos_common.h +++ b/qos_manager/include/qos_common.h @@ -21,7 +21,7 @@ namespace QosCommon { constexpr int AF_RTG_ALL = 0x1fff; struct AuthCtrlData { - int uid; + int pid; unsigned int type; unsigned int rtgFlag; unsigned int qosFlag; @@ -47,9 +47,9 @@ enum AuthStatus { #define BASIC_AUTH_CTRL_OPERATION \ _IOWR(0xCD, 1, struct AuthCtrlData) -int AuthEnable(int uid, unsigned int flag, unsigned int status); -int AuthPause(int uid); -int AuthDelete(int uid); +int AuthEnable(int pid, unsigned int flag, unsigned int status); +int AuthPause(int pid); +int AuthDelete(int pid); } // namespace QosCommon } // namespace OHOS diff --git a/qos_manager/src/qos_common.cpp b/qos_manager/src/qos_common.cpp index 4d8f616024a71bb3f89d9a1caed2adf9b4161f0b..53a39566ed88b5b2dfff61a9ea380e1eb6c654f6 100644 --- a/qos_manager/src/qos_common.cpp +++ b/qos_manager/src/qos_common.cpp @@ -34,7 +34,7 @@ static int TrivalOpenAuthCtrlNode(void) return fd; } -int AuthEnable(int uid, unsigned int flag, unsigned int status) +int AuthEnable(int pid, unsigned int flag, unsigned int status) { struct AuthCtrlData data; int fd; @@ -46,7 +46,7 @@ int AuthEnable(int uid, unsigned int flag, unsigned int status) return fd; } - data.uid = uid; + data.pid = pid; data.rtgFlag = flag; data.qosFlag = AF_QOS_DELEGATED; data.status = status; @@ -54,13 +54,13 @@ int AuthEnable(int uid, unsigned int flag, unsigned int status) ret = ioctl(fd, BASIC_AUTH_CTRL_OPERATION, &data); if (ret < 0) { - RME_LOGE("auth enable failed for uid %{public}d with status %{public}u\n", uid, status); + RME_LOGE("auth enable failed for pid %{public}d with status %{public}u\n", pid, status); } close(fd); return ret; } -int AuthPause(int uid) +int AuthPause(int pid) { struct AuthCtrlData data; int fd; @@ -72,7 +72,7 @@ int AuthPause(int uid) return fd; } - data.uid = uid; + data.pid = pid; data.rtgFlag = 0; data.qosFlag = AF_QOS_DELEGATED; data.status = AUTH_STATUS_BACKGROUND; @@ -80,13 +80,13 @@ int AuthPause(int uid) ret = ioctl(fd, BASIC_AUTH_CTRL_OPERATION, &data); if (ret < 0) { - RME_LOGE("auth pause failed for uid %{public}d\n", uid); + RME_LOGE("auth pause failed for pid %{public}d\n", pid); } close(fd); return ret; } -int AuthDelete(int uid) +int AuthDelete(int pid) { struct AuthCtrlData data; int fd; @@ -98,12 +98,12 @@ int AuthDelete(int uid) return fd; } - data.uid = uid; + data.pid = pid; data.type = AUTH_DELETE; ret = ioctl(fd, BASIC_AUTH_CTRL_OPERATION, &data); if (ret < 0) { - RME_LOGE("auth delete failed for uid %{public}d\n", uid); + RME_LOGE("auth delete failed for pid %{public}d\n", pid); } close(fd); return ret;