• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 #ifndef FIRMWARE_APPLY_EXECUTOR_H
17 #define FIRMWARE_APPLY_EXECUTOR_H
18 
19 #include "firmware_component.h"
20 #include "firmware_common.h"
21 #include "firmware_iexecutor.h"
22 #include "firmware_task.h"
23 #include "firmware_preferences_utils.h"
24 #include "firmware_install.h"
25 
26 namespace OHOS {
27 namespace UpdateEngine {
28 class FirmwareApplyExecutor : public FirmwareIExecutor {
29 public:
FirmwareApplyExecutor(FirmwareApplyCallback firmwareApplyCallback)30     FirmwareApplyExecutor(FirmwareApplyCallback firmwareApplyCallback)
31         : firmwareApplyCallback_(firmwareApplyCallback) {}
32     ~FirmwareApplyExecutor() = default;
33     void Execute() final;
34 
35 private:
36     void DoInstall();
37     void GetTask();
38 
39 private:
40     FirmwareApplyCallback firmwareApplyCallback_;
41     std::vector<FirmwareComponent> components_;
42     FirmwareTask tasks_;
43 };
44 } // namespace UpdateEngine
45 } // namespace OHOS
46 #endif // FIRMWARE_APPLY_EXECUTOR_H