mirror of
https://gitee.com/openharmony/filemanagement_storage_service
synced 2024-11-23 06:59:59 +00:00
告警处理
Signed-off-by: fangzhiyi18 <fangzhiyi1@huawei.com>
This commit is contained in:
parent
74c6ed5a88
commit
b3f3851473
@ -239,7 +239,8 @@ int32_t QuotaManager::SetQuotaPrjId(const std::string &path, int32_t prjId, bool
|
||||
(void)close(fd);
|
||||
return E_SYS_CALL;
|
||||
}
|
||||
if (fsx.fsx_projid == prjId) {
|
||||
uint32_t uintprjId = static_cast<uint32_t>(prjId);
|
||||
if (fsx.fsx_projid == uintprjId) {
|
||||
return E_OK;
|
||||
}
|
||||
fsx.fsx_projid = static_cast<uint32_t>(prjId);
|
||||
|
@ -24,6 +24,9 @@
|
||||
#include "storage_service_log.h"
|
||||
#include "utils/file_utils.h"
|
||||
|
||||
constexpr int32_t NUM4 = 4;
|
||||
constexpr int32_t NUM5 = 5;
|
||||
|
||||
static int32_t InitGlobalKey(const std::vector<std::string> &args)
|
||||
{
|
||||
(void)args;
|
||||
@ -39,7 +42,7 @@ static int32_t InitMainUser(const std::vector<std::string> &args)
|
||||
#ifdef SDC_TEST_ENABLE
|
||||
static int32_t GenerateUserKeys(const std::vector<std::string> &args)
|
||||
{
|
||||
if (args.size() < 5) {
|
||||
if (args.size() < NUM5) {
|
||||
LOGE("Parameter nums is less than 5, please retry");
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -56,7 +59,7 @@ static int32_t GenerateUserKeys(const std::vector<std::string> &args)
|
||||
|
||||
static int32_t PrepareUserSpace(const std::vector<std::string> &args)
|
||||
{
|
||||
if (args.size() < 5) {
|
||||
if (args.size() < NUM5) {
|
||||
LOGE("Parameter nums is less than 5, please retry");
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -73,7 +76,7 @@ static int32_t PrepareUserSpace(const std::vector<std::string> &args)
|
||||
|
||||
static int32_t DeleteUserKeys(const std::vector<std::string> &args)
|
||||
{
|
||||
if (args.size() < 4) {
|
||||
if (args.size() < NUM4) {
|
||||
LOGE("Parameter nums is less than 4, please retry");
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -88,7 +91,7 @@ static int32_t DeleteUserKeys(const std::vector<std::string> &args)
|
||||
|
||||
static int32_t DestroyUserSpace(const std::vector<std::string> &args)
|
||||
{
|
||||
if (args.size() < 5) {
|
||||
if (args.size() < NUM5) {
|
||||
LOGE("Parameter nums is less than 5, please retry");
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -105,7 +108,7 @@ static int32_t DestroyUserSpace(const std::vector<std::string> &args)
|
||||
|
||||
static int32_t UpdateUserAuth(const std::vector<std::string> &args)
|
||||
{
|
||||
if (args.size() < 5) {
|
||||
if (args.size() < NUM5) {
|
||||
LOGE("Parameter nums is less than 5, please retry");
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -128,7 +131,7 @@ static int32_t UpdateUserAuth(const std::vector<std::string> &args)
|
||||
|
||||
static int32_t ActiveUserKey(const std::vector<std::string> &args)
|
||||
{
|
||||
if (args.size() < 4) {
|
||||
if (args.size() < NUM4) {
|
||||
LOGE("Parameter nums is less than 4, please retry");
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -148,7 +151,7 @@ static int32_t ActiveUserKey(const std::vector<std::string> &args)
|
||||
|
||||
static int32_t InactiveUserKey(const std::vector<std::string> &args)
|
||||
{
|
||||
if (args.size() < 4) {
|
||||
if (args.size() < NUM4) {
|
||||
LOGE("Parameter nums is less than 4, please retry");
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -163,7 +166,7 @@ static int32_t InactiveUserKey(const std::vector<std::string> &args)
|
||||
|
||||
static int32_t LockUserScreen(const std::vector<std::string> &args)
|
||||
{
|
||||
if (args.size() < 4) {
|
||||
if (args.size() < NUM4) {
|
||||
LOGE("Parameter nums is less than 4, please retry");
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -178,7 +181,7 @@ static int32_t LockUserScreen(const std::vector<std::string> &args)
|
||||
|
||||
static int32_t UnlockUserScreen(const std::vector<std::string> &args)
|
||||
{
|
||||
if (args.size() < 4) {
|
||||
if (args.size() < NUM4) {
|
||||
LOGE("Parameter nums is less than 4, please retry");
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -193,7 +196,7 @@ static int32_t UnlockUserScreen(const std::vector<std::string> &args)
|
||||
|
||||
static int32_t EnableFscrypt(const std::vector<std::string> &args)
|
||||
{
|
||||
if (args.size() < 4) {
|
||||
if (args.size() < NUM4) {
|
||||
LOGE("Parameter nums is less than 4, please retry");
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -203,7 +206,7 @@ static int32_t EnableFscrypt(const std::vector<std::string> &args)
|
||||
|
||||
static int32_t UpdateKeyContext(const std::vector<std::string> &args)
|
||||
{
|
||||
if (args.size() < 4) {
|
||||
if (args.size() < NUM4) {
|
||||
LOGE("Parameter nums is less than 4, please retry");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -118,6 +118,11 @@ void AccountSubscriber::OnReceiveEvent(const EventFwk::CommonEventData &eventDat
|
||||
MountCryptoPathAgain(userId);
|
||||
}
|
||||
lock.unlock();
|
||||
GetSystemAbility();
|
||||
}
|
||||
|
||||
void AccountSubscriber::GetSystemAbility()
|
||||
{
|
||||
auto sam = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
|
||||
if (sam == nullptr) {
|
||||
LOGE("GetSystemAbilityManager sam == nullptr");
|
||||
@ -130,6 +135,7 @@ void AccountSubscriber::OnReceiveEvent(const EventFwk::CommonEventData &eventDat
|
||||
}
|
||||
mediaShare_ = DataShare::DataShareHelper::Creator(remoteObj, "datashare:///media");
|
||||
}
|
||||
|
||||
bool AccountSubscriber::OnReceiveEventLockUserScreen(int32_t userId)
|
||||
{
|
||||
std::shared_ptr<FileSystemCrypto> fsCrypto = DelayedSingleton<FileSystemCrypto>::GetInstance();
|
||||
|
@ -51,6 +51,8 @@ private:
|
||||
int32_t userId_ = 0;
|
||||
std::unordered_map<int32_t, uint32_t> userRecord_;
|
||||
bool OnReceiveEventLockUserScreen(int32_t userId);
|
||||
|
||||
void GetSystemAbility();
|
||||
};
|
||||
} // namespace StorageManager
|
||||
} // namespace OHOS
|
||||
|
Loading…
Reference in New Issue
Block a user