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 #include "firmware_access.h" 17 18 #include "access_manager.h" 19 #include "firmware_manager.h" 20 #include "update_log.h" 21 22 namespace OHOS { 23 namespace UpdateEngine { FirmwareAccess()24FirmwareAccess::FirmwareAccess() 25 { 26 ENGINE_LOGD("FirmwareAccess constructor"); 27 } 28 ~FirmwareAccess()29FirmwareAccess::~FirmwareAccess() 30 { 31 ENGINE_LOGD("FirmwareAccess deConstructor"); 32 } 33 Init(StartupReason startupReason)34void FirmwareAccess::Init(StartupReason startupReason) 35 { 36 ENGINE_LOGI("FirmwareAccess Init"); 37 DelayedSingleton<FirmwareManager>::GetInstance()->Init(startupReason); 38 DelayedSingleton<AccessManager>::GetInstance()->Register( 39 AccessType::FIRMWARE, DelayedSingleton<FirmwareAccess>::GetInstance()); 40 } 41 IsIdle()42bool FirmwareAccess::IsIdle() 43 { 44 return DelayedSingleton<FirmwareManager>::GetInstance()->IsIdle(); 45 } 46 GetScheduleTasks()47std::vector<ScheduleTask> FirmwareAccess::GetScheduleTasks() 48 { 49 return DelayedSingleton<FirmwareManager>::GetInstance()->GetScheduleTasks(); 50 } 51 Exit()52bool FirmwareAccess::Exit() 53 { 54 return DelayedSingleton<FirmwareManager>::GetInstance()->Exit(); 55 } 56 } // namespace UpdateEngine 57 } // namespace OHOS