mirror of
https://gitee.com/openharmony/security_asset
synced 2024-10-06 22:03:31 +00:00
xc comment change 7
Signed-off-by: Cai Xincheng <caixincheng@huawei.com> Change-Id: I564ad496cec2fc104985ad9912a418d726fc7f09
This commit is contained in:
parent
89c607dfe6
commit
0cf3355fcd
@ -42,6 +42,7 @@ use crate::sys_event::upload_fault_system_event;
|
||||
/// success code.
|
||||
const SUCCESS: i32 = 0;
|
||||
const USER_ID_VEC_BUFFER: u32 = 5;
|
||||
const MINIMUM_MAIN_USER_ID: i32 = 100;
|
||||
|
||||
fn remove_db(file_path: &str, calling_info: &CallingInfo, is_ce: bool) -> Result<()> {
|
||||
let db_name = construct_splited_db_name(calling_info.owner_type_enum(), calling_info.owner_info(), is_ce)?;
|
||||
@ -268,6 +269,9 @@ fn backup_de_db_if_accessible(entry: &DirEntry, user_id: i32) -> Result<()> {
|
||||
}
|
||||
|
||||
fn backup_ce_db(user_id: i32) -> Result<()> {
|
||||
if user_id < MINIMUM_MAIN_USER_ID {
|
||||
return Ok(());
|
||||
}
|
||||
let ce_path = format!("{}/{}/asset_service", CE_ROOT_PATH, user_id);
|
||||
for db_path in fs::read_dir(ce_path)? {
|
||||
let db_path = db_path?;
|
||||
|
@ -66,7 +66,6 @@ int32_t GetUserIds(int32_t *userIdsPtr, uint32_t *userIdsSize)
|
||||
for (uint32_t i = 0; i < *userIdsSize; i++) {
|
||||
userIdsPtr[i] = userIdsVec[i];
|
||||
}
|
||||
|
||||
*userIdsSize = static_cast<uint32_t>(userIdsVec.size());
|
||||
|
||||
return ASSET_SUCCESS;
|
||||
@ -84,7 +83,10 @@ int32_t GetUsersSize(uint32_t *userIdsSize)
|
||||
LOGE("[FATAL]accountInfos is empty");
|
||||
return ASSET_ACCOUNT_ERROR;
|
||||
}
|
||||
*userIdsSize = static_cast<uint32_t>(accountInfos.size());
|
||||
std::vector<int32_t> userIdsVec = { 0 };
|
||||
std::transform(accountInfos.begin(), accountInfos.end(), std::back_inserter(userIdsVec),
|
||||
[](auto &iter) { return iter.GetLocalId(); });
|
||||
*userIdsSize = static_cast<uint32_t>(userIdsVec.size());
|
||||
|
||||
return ASSET_SUCCESS;
|
||||
}
|
Loading…
Reference in New Issue
Block a user