• 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 SCHEDULE_MANAGER_H
17 #define SCHEDULE_MANAGER_H
18 
19 #include <memory>
20 
21 #include "access_manager.h"
22 #include "schedule_task.h"
23 #include "startup_schedule.h"
24 
25 namespace OHOS {
26 namespace UpdateEngine {
27 class ScheduleManager final {
28 public:
29     ScheduleManager(
30         const std::shared_ptr<IAccessManager> &accessManager, const std::shared_ptr<IStartupSchedule> &startupSchedule);
31     ~ScheduleManager();
32     bool IdleCheck();
33     bool Exit();
34 
35 private:
36     bool TaskManage(ScheduleTask &scheduleTask);
37     bool TaskSchedule(const ScheduleTask &scheduleTask);
38 
39 private:
40     std::shared_ptr<IAccessManager> accessManager_;
41     std::shared_ptr<IStartupSchedule> startupSchedule_;
42     ScheduleTask scheduleTask_;
43 };
44 } // namespace UpdateEngine
45 } // namespace OHOS
46 #endif // SCHEDULE_MANAGER_H