1 /* 2 * Copyright (c) 2021-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 POWERMGR_SERVICES_IPOWER_MANAGER_STUB_H 17 #define POWERMGR_SERVICES_IPOWER_MANAGER_STUB_H 18 19 #include <iremote_stub.h> 20 #include <nocopyable.h> 21 22 #include "ipower_mgr.h" 23 24 namespace OHOS { 25 namespace PowerMgr { 26 class PowerMgrStub : public IRemoteStub<IPowerMgr> { 27 public: 28 DISALLOW_COPY_AND_MOVE(PowerMgrStub); 29 PowerMgrStub() = default; 30 virtual ~PowerMgrStub() = default; 31 int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 32 33 private: 34 int32_t WakeupDeviceStub(MessageParcel& data, MessageParcel& reply); 35 int32_t SuspendDeviceStub(MessageParcel& data, MessageParcel& reply); 36 int32_t RefreshActivityStub(MessageParcel& data); 37 int32_t OverrideScreenOffTimeStub(MessageParcel& data, MessageParcel& reply); 38 int32_t RestoreScreenOffTimeStub(MessageParcel& reply); 39 int32_t GetStateStub(MessageParcel& reply); 40 int32_t IsScreeOnStub(MessageParcel& reply); 41 int32_t ForceSuspendDeviceStub(MessageParcel& data, MessageParcel& reply); 42 int32_t ProxyRunningLockStub(MessageParcel& data); 43 int32_t CreateRunningLockStub(MessageParcel& data, MessageParcel& reply); 44 int32_t ReleaseRunningLockStub(MessageParcel& data); 45 int32_t IsRunningLockTypeSupportedStub(MessageParcel& data, MessageParcel& reply); 46 int32_t LockStub(MessageParcel& data); 47 int32_t UnLockStub(MessageParcel& data); 48 int32_t SetWorkTriggerListStub(MessageParcel& data); 49 int32_t IsUsedStub(MessageParcel& data, MessageParcel& reply); 50 int32_t RebootDeviceStub(MessageParcel& data, MessageParcel& reply); 51 int32_t RebootDeviceForDeprecatedStub(MessageParcel& data, MessageParcel& reply); 52 int32_t ShutDownDeviceStub(MessageParcel& data, MessageParcel& reply); 53 int32_t RegisterPowerStateCallbackStub(MessageParcel& data); 54 int32_t UnRegisterPowerStateCallbackStub(MessageParcel& data); 55 int32_t RegisterShutdownCallbackStub(MessageParcel& data); 56 int32_t UnRegisterShutdownCallbackStub(MessageParcel& data); 57 int32_t RegisterPowerModeCallbackStub(MessageParcel& data); 58 int32_t UnRegisterPowerModeCallbackStub(MessageParcel& data); 59 int32_t SetDisplaySuspendStub(MessageParcel& data); 60 int32_t SetDeviceModeStub(MessageParcel& data, MessageParcel& reply); 61 int32_t GetDeviceModeStub(MessageParcel& reply); 62 int32_t ShellDumpStub(MessageParcel& data, MessageParcel& reply); 63 }; 64 } // namespace PowerMgr 65 } // namespace OHOS 66 #endif // POWERMGR_SERVICES_IPOWER_MANAGER_STUB_H 67