From 6fd7ccbf31d1829653659785a64e41aaa82521aa Mon Sep 17 00:00:00 2001 From: "zhaoyuan17@huawei.com" Date: Mon, 18 Oct 2021 21:37:37 +0800 Subject: [PATCH] codex Signed-off-by: zhaoyuan17@huawei.com --- services/formmgr/src/form_mgr_adapter.cpp | 2 +- services/formmgr/src/form_refresh_limiter.cpp | 10 +++++----- services/formmgr/src/form_timer_mgr.cpp | 4 ++-- .../common/fms/common/src/system_test_form_util.cpp | 2 +- .../fms/fms_delete_form_test/fms_delete_form_test.cpp | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/services/formmgr/src/form_mgr_adapter.cpp b/services/formmgr/src/form_mgr_adapter.cpp index df9641341..7a065d01b 100644 --- a/services/formmgr/src/form_mgr_adapter.cpp +++ b/services/formmgr/src/form_mgr_adapter.cpp @@ -803,7 +803,7 @@ ErrCode FormMgrAdapter::AddExistFormRecord(const FormItemInfo &info, const sptr< // Add new form user uid. FormDataMgr::GetInstance().AddFormUserUid(formId, callingUid); - if(std::find(newRecord.formUserUids.begin(), newRecord.formUserUids.end(), callingUid) == + if (std::find(newRecord.formUserUids.begin(), newRecord.formUserUids.end(), callingUid) == newRecord.formUserUids.end()) { newRecord.formUserUids.emplace_back(callingUid); } diff --git a/services/formmgr/src/form_refresh_limiter.cpp b/services/formmgr/src/form_refresh_limiter.cpp index b0c814350..4b5fb2928 100644 --- a/services/formmgr/src/form_refresh_limiter.cpp +++ b/services/formmgr/src/form_refresh_limiter.cpp @@ -26,14 +26,14 @@ namespace AppExecFwk { * @param formId The id of the form. * @return Returns true on success, false on failure. */ -bool FormRefreshLimiter::AddItem(const int64_t formId) +bool FormRefreshLimiter::AddItem(const int64_t formId) { APP_LOGI("%{public}s start", __func__); std::lock_guard lock(limiterMutex_); auto info = limiterMap_.find(formId); if (info == limiterMap_.end()) { LimitInfo limitInfo; - std::pair::iterator, bool> retVal = + std::pair::iterator, bool> retVal = limiterMap_.emplace(formId, limitInfo); APP_LOGI("%{public}s end", __func__); return retVal.second; @@ -46,7 +46,7 @@ bool FormRefreshLimiter::AddItem(const int64_t formId) * @brief Delete form limit info by formId. * @param formId The form id. */ -void FormRefreshLimiter::DeleteItem(const int64_t formId) +void FormRefreshLimiter::DeleteItem(const int64_t formId) { APP_LOGI("%{public}s start", __func__); std::lock_guard lock(limiterMutex_); @@ -121,7 +121,7 @@ void FormRefreshLimiter::Increase(const int64_t formId) APP_LOGI("%{public}s start", __func__); std::lock_guard lock(limiterMutex_); auto info = limiterMap_.find(formId); - if (info != limiterMap_.end()) { + if (info != limiterMap_.end()) { info->second.refreshCount++; APP_LOGI("increase,formId:%{public}" PRId64 ", count:%{public}d", formId, info->second.refreshCount); if (info->second.refreshCount == Constants::LIMIT_COUNT && !info->second.isReported) { @@ -140,7 +140,7 @@ void FormRefreshLimiter::MarkRemind(const int64_t formId) APP_LOGI("%{public}s start", __func__); std::lock_guard lock(limiterMutex_); auto info = limiterMap_.find(formId); - if (info != limiterMap_.end()) { + if (info != limiterMap_.end()) { if (info->second.refreshCount >= Constants::LIMIT_COUNT) { info->second.remindFlag = true; } diff --git a/services/formmgr/src/form_timer_mgr.cpp b/services/formmgr/src/form_timer_mgr.cpp index 4c7eadcae..909ac54de 100644 --- a/services/formmgr/src/form_timer_mgr.cpp +++ b/services/formmgr/src/form_timer_mgr.cpp @@ -665,9 +665,9 @@ bool FormTimerMgr::GetUpdateAtTimer(const int64_t formId, UpdateAtItem &updateAt bool FormTimerMgr::GetDynamicItem(const int64_t formId, DynamicRefreshItem &dynamicItem) { APP_LOGI("%{public}s start", __func__); - std::lock_guard lock(dynamicMutex_); + std::lock_guard lock(dynamicMutex_); std::vector::iterator itItem; - for (itItem = dynamicRefreshTasks_.begin(); itItem != dynamicRefreshTasks_.end();) { + for (itItem = dynamicRefreshTasks_.begin(); itItem != dynamicRefreshTasks_.end(); ) { if (itItem->formId == formId) { dynamicItem.formId = itItem->formId; dynamicItem.settedTime = itItem->settedTime; diff --git a/test/systemtest/common/fms/common/src/system_test_form_util.cpp b/test/systemtest/common/fms/common/src/system_test_form_util.cpp index c08b646e9..126817d6d 100644 --- a/test/systemtest/common/fms/common/src/system_test_form_util.cpp +++ b/test/systemtest/common/fms/common/src/system_test_form_util.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ #include "system_test_form_util.h" -#include "install_tool_status_receiver.h" #include "iservice_registry.h" #include "status_receiver_host.h" +#include "install_tool_status_receiver.h" namespace OHOS { namespace STtools { diff --git a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp index 5d6872776..4aae43bb0 100644 --- a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp +++ b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp @@ -704,7 +704,7 @@ HWTEST_F(FmsDeleteFormTest, FMS_deleteForm_1200, Function | MediumTest | Level2) SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); int tmp = 5; - std::string eventData = ((i/tmp == 1) ? "true" : "false"); + std::string eventData = ((i / tmp == 1) ? "true" : "false"); SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1200, EVENT_CODE_1200, eventData); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1200, EVENT_CODE_1200)); formIds[i] = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1200, EVENT_CODE_1200); @@ -894,7 +894,7 @@ void FmsDeleteFormTest::FMS_deleteForm_1400_A() SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); int tmp = 5; - std::string eventData = ((i/tmp == 1) ? "true" : "false"); + std::string eventData = ((i / tmp == 1) ? "true" : "false"); SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_ONE_NORMAL_FORM, EVENT_CODE_1400, eventData); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100)); formIds[i] = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100); @@ -936,7 +936,7 @@ void FmsDeleteFormTest::FMS_deleteForm_1400_B() SystemTestFormUtil::StartAbility(want, abilityManager); EXPECT_EQ(SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_ABILITY_ONACTIVED, 0), 0); int tmp = 5; - std::string eventData = ((i/tmp == 1) ? "true" : "false"); + std::string eventData = ((i / tmp == 1) ? "true" : "false"); SystemTestFormUtil::PublishEvent(FORM_EVENT_REQ_DELETE_FORM_1400, EVENT_CODE_1400, eventData); EXPECT_EQ(0, SystemTestFormUtil::WaitCompleted(event, FORM_EVENT_RECV_DELETE_FORM_1400, EVENT_CODE_1400)); formIds[i] = SystemTestFormUtil::GetData(event, FORM_EVENT_RECV_DELETE_FORM_1400, EVENT_CODE_1400);