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 ~PowerMgrStub() override = default; 31 int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; 32 33 private: 34 static bool IsShutdownCommand(uint32_t code); 35 36 int32_t WakeupDeviceStub(MessageParcel& data, MessageParcel& reply); 37 int32_t SuspendDeviceStub(MessageParcel& data, MessageParcel& reply); 38 int32_t RefreshActivityStub(MessageParcel& data); 39 int32_t OverrideScreenOffTimeStub(MessageParcel& data, MessageParcel& reply); 40 int32_t RestoreScreenOffTimeStub(MessageParcel& reply); 41 int32_t GetStateStub(MessageParcel& reply); 42 int32_t IsScreenOnStub(MessageParcel& reply); 43 int32_t ForceSuspendDeviceStub(MessageParcel& data, MessageParcel& reply); 44 int32_t ProxyRunningLockStub(MessageParcel& data, MessageParcel& reply); 45 int32_t ProxyRunningLocksStub(MessageParcel& data, MessageParcel& reply); 46 int32_t ResetAllPorxyStub(MessageParcel& data, MessageParcel& reply); 47 int32_t CreateRunningLockStub(MessageParcel& data, MessageParcel& reply); 48 int32_t ReleaseRunningLockStub(MessageParcel& data); 49 int32_t IsRunningLockTypeSupportedStub(MessageParcel& data, MessageParcel& reply); 50 int32_t LockStub(MessageParcel& data); 51 int32_t UnLockStub(MessageParcel& data); 52 int32_t IsUsedStub(MessageParcel& data, MessageParcel& reply); 53 int32_t RebootDeviceStub(MessageParcel& data, MessageParcel& reply); 54 int32_t RebootDeviceForDeprecatedStub(MessageParcel& data, MessageParcel& reply); 55 int32_t ShutDownDeviceStub(MessageParcel& data, MessageParcel& reply); 56 int32_t RegisterPowerStateCallbackStub(MessageParcel& data); 57 int32_t UnRegisterPowerStateCallbackStub(MessageParcel& data); 58 int32_t RegisterPowerModeCallbackStub(MessageParcel& data); 59 int32_t UnRegisterPowerModeCallbackStub(MessageParcel& data); 60 int32_t SetDisplaySuspendStub(MessageParcel& data); 61 int32_t SetDeviceModeStub(MessageParcel& data, MessageParcel& reply); 62 int32_t GetDeviceModeStub(MessageParcel& reply); 63 int32_t ShellDumpStub(MessageParcel& data, MessageParcel& reply); 64 int32_t IsStandbyStub(MessageParcel& data, MessageParcel& reply); 65 }; 66 } // namespace PowerMgr 67 } // namespace OHOS 68 #endif // POWERMGR_SERVICES_IPOWER_MANAGER_STUB_H 69