diff --git a/interfaces/innerkits/el5filekeymanager/include/el5_filekey_manager_client.h b/interfaces/innerkits/el5filekeymanager/include/el5_filekey_manager_client.h index 4a1d23f05c241bbb674fc8e018a2b06e01b524d4..7c20df1cbfa218c5ff56e6ffc104120a87b313a3 100644 --- a/interfaces/innerkits/el5filekeymanager/include/el5_filekey_manager_client.h +++ b/interfaces/innerkits/el5filekeymanager/include/el5_filekey_manager_client.h @@ -37,7 +37,7 @@ public: int32_t SetFilePathPolicy(); int32_t RegisterCallback(const sptr &callback); int32_t CallProxyWithRetry(const std::function &)> &func, - const char *funcName); + const char *funcName, int32_t def = EFM_ERR_REMOTE_CONNECTION); bool IsRequestNeedRetry(int32_t ret); private: diff --git a/interfaces/innerkits/el5filekeymanager/src/el5_filekey_manager_client.cpp b/interfaces/innerkits/el5filekeymanager/src/el5_filekey_manager_client.cpp index c1290c8789fcbdc17022c5ab5d44b3600e083c2f..6ae66a47c9d3de4236e91f7197246516252a63f5 100644 --- a/interfaces/innerkits/el5filekeymanager/src/el5_filekey_manager_client.cpp +++ b/interfaces/innerkits/el5filekeymanager/src/el5_filekey_manager_client.cpp @@ -80,7 +80,7 @@ int32_t El5FilekeyManagerClient::GetUserAppKey(int32_t userId, bool getAllFlag, std::function &)> func = [&](sptr &proxy) { return proxy->GetUserAppKey(userId, getAllFlag, keyInfos); }; - return CallProxyWithRetry(func, __FUNCTION__); + return CallProxyWithRetry(func, __FUNCTION__, EFM_SUCCESS); } int32_t El5FilekeyManagerClient::ChangeUserAppkeysLoadInfo(int32_t userId, @@ -137,7 +137,7 @@ sptr El5FilekeyManagerClient::GetProxy() } int32_t El5FilekeyManagerClient::CallProxyWithRetry( - const std::function &)> &func, const char *funcName) + const std::function &)> &func, const char *funcName, int32_t def) { LOG_INFO("call proxy with retry function:%s", funcName); auto proxy = GetProxy(); @@ -164,7 +164,7 @@ int32_t El5FilekeyManagerClient::CallProxyWithRetry( LOG_WARN("Call %{public}s failed, retry time = %{public}d, result = %{public}d", funcName, i, ret); } LOG_ERROR("Retry call service %{public}s error, tried %{public}d times.", funcName, SA_REQUEST_RETRY_TIMES); - return EFM_ERR_REMOTE_CONNECTION; + return def; } bool El5FilekeyManagerClient::IsRequestNeedRetry(int32_t ret)