diff --git a/services/appmgr/include/app_mgr_service_inner.h b/services/appmgr/include/app_mgr_service_inner.h index 5f5174c4d5..1da68ed4c7 100644 --- a/services/appmgr/include/app_mgr_service_inner.h +++ b/services/appmgr/include/app_mgr_service_inner.h @@ -49,7 +49,6 @@ namespace OHOS { namespace AppExecFwk { -const int32_t DEFAULT_UID = -1; using OHOS::AAFwk::Want; class AppMgrServiceInner : public std::enable_shared_from_this { public: @@ -526,7 +525,7 @@ public: virtual int GetRenderProcessTerminationStatus(pid_t renderPid, int &status); - int VerifyProcessPermission(int uid = DEFAULT_UID); + int VerifyProcessPermission(); int VerifyAccountPermission(const std::string &permissionName, const int userId); diff --git a/services/appmgr/src/app_mgr_service_inner.cpp b/services/appmgr/src/app_mgr_service_inner.cpp index 6e56c305b9..2eb1a774d3 100644 --- a/services/appmgr/src/app_mgr_service_inner.cpp +++ b/services/appmgr/src/app_mgr_service_inner.cpp @@ -499,7 +499,7 @@ int32_t AppMgrServiceInner::KillApplicationByUid(const std::string &bundleName, return ERR_NO_INIT; } - auto errCode = VerifyProcessPermission(uid); + auto errCode = VerifyProcessPermission(); if (errCode != ERR_OK) { HILOG_ERROR("%{public}s: Permission verification failed", __func__); return errCode; @@ -2378,7 +2378,7 @@ int AppMgrServiceInner::GetApplicationInfoByProcessID(const int pid, AppExecFwk: return ERR_OK; } -int AppMgrServiceInner::VerifyProcessPermission(int uid) +int AppMgrServiceInner::VerifyProcessPermission() { auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall(); if (isSaCall) { @@ -2397,10 +2397,6 @@ int AppMgrServiceInner::VerifyProcessPermission(int uid) return ERR_INVALID_OPERATION; } - if (uid != DEFAULT_UID && IPCSkeleton::GetCallingUid() == uid) { - return ERR_OK; - } - auto applicationInfo = appRecord->GetApplicationInfo(); if (!applicationInfo) { HILOG_ERROR("Get application info failed.");