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/**
17 * @addtogroup power
18 * @{
19 *
20 * @brief Provides APIs for performing hibernation/wakeup operations, subscribing to the hibernation/wakeup status,
21 * and managing running locks.
22 *
23 * After obtaining an object or proxy of this module, the power service can invoke related APIs to perform
24 * hibernation/wakeup operations, subscribe to the hibernation/wakeup status, and manage running locks.
25 *
26 * @since 3.1
27 * @version 1.0
28 */
29
30/**
31 * @file IPowerInterface.idl
32 *
33 * @brief Provides APIs for performing hibernation/wakeup operations, subscribing to the hibernation/wakeup status,
34 * and managing running locks.
35 *
36 *
37 *
38 * @since 3.1
39 * @version 1.0
40 */
41
42package ohos.hdi.power.v1_0;
43
44import ohos.hdi.power.v1_0.IPowerHdiCallback;
45import ohos.hdi.power.v1_0.PowerTypes;
46
47/**
48 * @brief Represents APIs for performing hibernation/wakeup operations, subscribing to the hibernation/wakeup status,
49 * and managing running locks.
50 *
51 *
52 *
53 * @since 3.1
54 */
55interface IPowerInterface {
56    /**
57     * @brief Registers the callback of the hibernation/wakeup status.
58     *
59     * @param ipowerHdiCallback Callback to register.
60     *
61     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
62     * @see IPowerHdiCallback
63     *
64     * @since 3.1
65     */
66    RegisterCallback([in] IPowerHdiCallback ipowerHdiCallback);
67
68    /**
69     * @brief Hibernates a device.
70     *
71     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
72     *
73     * @since 3.1
74     */
75    StartSuspend();
76
77    /**
78     * @brief Wakes up a device.
79     *
80     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
81     *
82     * @since 3.1
83     */
84    StopSuspend();
85
86    /**
87     * @brief Forcibly hibernates a device.
88     *
89     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
90     *
91     * @since 3.1
92     */
93    ForceSuspend();
94
95    /**
96     * @brief Enables the running lock to block device hibernation.
97     *
98     * @param name Name of the running lock.
99     *
100     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
101     *
102     * @since 3.1
103     */
104    SuspendBlock([in] String name);
105
106    /**
107     * @brief Disables the running lock to unblock device hibernation.
108     *
109     * @param name Name of the running lock.
110     *
111     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
112     *
113     * @since 3.1
114     */
115    SuspendUnblock([in] String name);
116
117    /**
118     * @brief Obtains the power dump information.
119     *
120     * @param info Power dump information.
121     *
122     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
123     *
124     * @since 3.1
125     */
126    PowerDump([out] String info);
127}
128/** @} */
129