fix code alarm

Change-Id: I68a90fdd194d99201f798425005a0aa2139839ed
Signed-off-by: j21p3 <yanjun59@huawei.com>
This commit is contained in:
j21p3 2024-10-24 11:56:50 +08:00
parent 42e9ee6a8c
commit 1a68eb5e27
3 changed files with 7 additions and 7 deletions

View File

@ -43,7 +43,6 @@ public:
private:
static float GetWindowScale(int32_t windowId);
static void AdjustSecCompRect(SecCompBase* comp, float scale);
static bool IsDlpSandboxCalling(AccessToken::AccessTokenID tokenId);
};
} // namespace SecurityComponent
} // namespace Security

View File

@ -268,6 +268,13 @@ void SecCompPermManager::InitEventHandler(const std::shared_ptr<SecEventHandler>
secHandler_ = secHandler;
}
namespace {
inline bool IsDlpSandboxCalling(AccessToken::AccessTokenID tokenId)
{
return AccessToken::AccessTokenKit::GetHapDlpFlag(tokenId) != 0;
}
}
int32_t SecCompPermManager::GrantTempPermission(AccessToken::AccessTokenID tokenId,
const std::shared_ptr<SecCompBase>& componentInfo)
{
@ -313,11 +320,6 @@ int32_t SecCompPermManager::GrantTempPermission(AccessToken::AccessTokenID token
}
return SC_SERVICE_ERROR_PERMISSION_OPER_FAIL;
}
inline bool SecCompPermManager::IsDlpSandboxCalling(AccessToken::AccessTokenID tokenId)
{
return AccessToken::AccessTokenKit::GetHapDlpFlag(tokenId) != 0;
}
} // namespace SecurityComponent
} // namespace Security
} // namespace OHOS

View File

@ -59,7 +59,6 @@ private:
const std::string& permissionName);
void RemoveAppGrantPermissionRecord(AccessToken::AccessTokenID tokenId,
const std::string& permissionName);
bool IsDlpSandboxCalling(AccessToken::AccessTokenID tokenId);
std::unordered_map<AccessToken::AccessTokenID, int32_t> applySaveCountMap_;
std::unordered_map<AccessToken::AccessTokenID, std::deque<std::string>> saveTaskDequeMap_;