/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @addtogroup power * @{ * * @brief Provides APIs for performing hibernation/wakeup operations, subscribing to the hibernation/wakeup status, * and managing running locks. * * After obtaining an object or proxy of this module, the power service can invoke related APIs to perform * hibernation/wakeup operations, subscribe to the hibernation/wakeup status, and manage running locks. * * @since 3.1 * @version 1.0 */ /** * @file IPowerInterface.idl * * @brief Provides APIs for performing hibernation/wakeup operations, subscribing to the hibernation/wakeup status, * and managing running locks. * * * * @since 3.1 * @version 1.0 */ package ohos.hdi.power.v1_0; import ohos.hdi.power.v1_0.IPowerHdiCallback; import ohos.hdi.power.v1_0.PowerTypes; /** * @brief Represents APIs for performing hibernation/wakeup operations, subscribing to the hibernation/wakeup status, * and managing running locks. * * * * @since 3.1 */ interface IPowerInterface { /** * @brief Registers the callback of the hibernation/wakeup status. * * @param ipowerHdiCallback Callback to register. * * @return Returns HDF_SUCCESS if the operation is successful. * @see IPowerHdiCallback * * @since 3.1 */ RegisterCallback([in] IPowerHdiCallback ipowerHdiCallback); /** * @brief Hibernates a device. * * @return Returns HDF_SUCCESS if the operation is successful. * * @since 3.1 */ StartSuspend(); /** * @brief Wakes up a device. * * @return Returns HDF_SUCCESS if the operation is successful. * * @since 3.1 */ StopSuspend(); /** * @brief Forcibly hibernates a device. * * @return Returns HDF_SUCCESS if the operation is successful. * * @since 3.1 */ ForceSuspend(); /** * @brief Enables the running lock to block device hibernation. * * @param name Name of the running lock. * * @return Returns HDF_SUCCESS if the operation is successful. * * @since 3.1 */ SuspendBlock([in] String name); /** * @brief Disables the running lock to unblock device hibernation. * * @param name Name of the running lock. * * @return Returns HDF_SUCCESS if the operation is successful. * * @since 3.1 */ SuspendUnblock([in] String name); /** * @brief Obtains the power dump information. * * @param info Power dump information. * * @return Returns HDF_SUCCESS if the operation is successful. * * @since 3.1 */ PowerDump([out] String info); } /** @} */