mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-12-19 06:47:09 +00:00
回退 'Pull Request !2793 : 允许应用killApplication自己'
This commit is contained in:
parent
7ab69dc431
commit
a584de5976
@ -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<AppMgrServiceInner> {
|
||||
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);
|
||||
|
||||
|
@ -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.");
|
||||
|
Loading…
Reference in New Issue
Block a user