1 /* 2 * Copyright (c) 2022 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 POWERMGR_POWER_MANAGER_DEFAULT_DEVICE_STATE_ACTION_H 17 #define POWERMGR_POWER_MANAGER_DEFAULT_DEVICE_STATE_ACTION_H 18 19 #include "actions/idevice_state_action.h" 20 21 namespace OHOS { 22 namespace PowerMgr { 23 class DefaultDeviceStateAction : public IDeviceStateAction { 24 public: 25 DefaultDeviceStateAction() = default; 26 ~DefaultDeviceStateAction() override = default; 27 void Suspend(int64_t callTimeMs, SuspendDeviceType type, uint32_t flags) override; 28 void ForceSuspend() override; 29 void Wakeup(int64_t callTimeMs, WakeupDeviceType type, const std::string& details, 30 const std::string& pkgName) override; RefreshActivity(const int64_t callTimeMs,UserActivityType type,const uint32_t flags)31 void RefreshActivity(const int64_t callTimeMs, UserActivityType type, 32 const uint32_t flags) override {} 33 DisplayState GetDisplayState() override; 34 bool TryToCancelScreenOff() override; BeginPowerkeyScreenOff()35 void BeginPowerkeyScreenOff() override {}; EndPowerkeyScreenOff()36 void EndPowerkeyScreenOff() override {}; 37 uint32_t SetDisplayState(DisplayState state, 38 StateChangeReason reason = StateChangeReason::STATE_CHANGE_REASON_UNKNOWN) override; 39 void SetCoordinated(bool coordinated) override; 40 uint32_t GoToSleep(std::function<void()> onSuspend, std::function<void()> onWakeup, bool force) override; 41 void RegisterCallback(std::function<void(uint32_t)>& callback) override; 42 }; 43 } // namespace PowerMgr 44 } // namespace OHOS 45 #endif // POWERMGR_POWER_MANAGER_DEFAULT_DEVICE_STATE_ACTION_H 46