clean after unlock

Signed-off-by: yeyuning <yeyuning2@huawei.com>
Change-Id: Iaa0c80272dc436517d59d1d67f3996711970556e
This commit is contained in:
yeyuning 2024-09-19 11:49:55 +08:00
parent 12af702733
commit 2858645c51
2 changed files with 11 additions and 3 deletions

View File

@ -297,9 +297,6 @@ void AccountMgrService::OnAddSystemAbility(int32_t systemAbilityId, const std::s
isDefaultOsAccountActivated_ = true;
}
}
if (isBmsReady_ && isAmsReady_) {
IInnerOsAccountManager::GetInstance().CleanGarbageOsAccounts();
}
}
bool AccountMgrService::Init()

View File

@ -1697,6 +1697,11 @@ ErrCode IInnerOsAccountManager::SendMsgForAccountActivate(OsAccountInfo &osAccou
subscribeManager_.Publish(localId, OS_ACCOUNT_SUBSCRIBE_TYPE::UNLOCKED);
}
auto task = [] { IInnerOsAccountManager::GetInstance().CleanGarbageOsAccounts(); };
std::thread cleanThread(task);
pthread_setname_np(cleanThread.native_handle(), "CleanGarbageOsAccounts");
cleanThread.detach();
if (oldIdExist && (oldId != localId)) {
errCode = UpdateAccountToBackground(oldId);
if (errCode != ERR_OK) {
@ -1837,6 +1842,12 @@ ErrCode IInnerOsAccountManager::SetOsAccountIsVerified(const int id, const bool
OHOS::EventFwk::CommonEventSupport::COMMON_EVENT_USER_UNLOCKED, Constants::OPERATION_UNLOCK);
subscribeManager_.Publish(id, OS_ACCOUNT_SUBSCRIBE_TYPE::UNLOCKED);
}
auto task = [] { IInnerOsAccountManager::GetInstance().CleanGarbageOsAccounts(); };
std::thread cleanThread(task);
pthread_setname_np(cleanThread.native_handle(), "CleanGarbageOsAccounts");
cleanThread.detach();
return ERR_OK;
}