From eece4b6ddabbfaeda8aadb50a84ea1117ba3b0c1 Mon Sep 17 00:00:00 2001 From: sunxuhui Date: Fri, 24 May 2024 09:57:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=9A=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=B9=B6=E5=8F=91=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sunxuhui --- services/dbms/src/account_manager_helper.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/services/dbms/src/account_manager_helper.cpp b/services/dbms/src/account_manager_helper.cpp index 6f3ddc1..7fcc6f1 100644 --- a/services/dbms/src/account_manager_helper.cpp +++ b/services/dbms/src/account_manager_helper.cpp @@ -29,17 +29,13 @@ namespace AppExecFwk { int32_t AccountManagerHelper::GetCurrentActiveUserId() { #ifdef ACCOUNT_ENABLE - std::vector activeIds; - int ret = AccountSA::OsAccountManager::QueryActiveOsAccountIds(activeIds); + std::int32_t localId; + int32_t ret = AccountSA::OsAccountManager::GetForegroundOsAccountLocalId(localId); if (ret != 0) { - APP_LOGE("QueryActiveOsAccountIds failed ret:%{public}d", ret); + APP_LOGE("GetForegroundOsAccountLocalId failed ret:%{public}d", ret); return Constants::INVALID_USERID; } - if (activeIds.empty()) { - APP_LOGE("QueryActiveOsAccountIds activeIds empty"); - return Constants::INVALID_USERID; - } - return activeIds[0]; + return localId; #else APP_LOGI("ACCOUNT_ENABLE is false"); return Constants::INVALID_USERID; -- Gitee