1 /*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "form_refresh/refresh_impl/form_force_refresh_impl.h"
17
18 #include "form_refresh/strategy/refresh_check_mgr.h"
19 #include "form_refresh/strategy/refresh_exec_mgr.h"
20
21 namespace OHOS {
22 namespace AppExecFwk {
23
FormForceRefreshImpl()24 FormForceRefreshImpl::FormForceRefreshImpl() {}
~FormForceRefreshImpl()25 FormForceRefreshImpl::~FormForceRefreshImpl() {}
26
RefreshFormRequest(RefreshData & data)27 int FormForceRefreshImpl::RefreshFormRequest(RefreshData &data)
28 {
29 const std::vector<int32_t> checkTypes = {};
30 CheckValidFactor factor;
31 int ret = RefreshCheckMgr::GetInstance().IsBaseValidPass(checkTypes, factor);
32 if (ret != ERR_OK) {
33 return ret;
34 }
35
36 Want reqWant;
37 ret = RefreshExecMgr::AskForProviderData(data.record.formId, data.record, reqWant);
38 if (ret != ERR_OK) {
39 HILOG_ERROR("ask for provider data failed, ret:%{public}d, formId:%{public}" PRId64, ret, data.formId);
40 return ret;
41 }
42
43 return ERR_OK;
44 }
45 } // namespace AppExecFwk
46 } // namespace OHOS