1c5e268c6Sopenharmony_ci/*
2c5e268c6Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
3c5e268c6Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4c5e268c6Sopenharmony_ci * you may not use this file except in compliance with the License.
5c5e268c6Sopenharmony_ci * You may obtain a copy of the License at
6c5e268c6Sopenharmony_ci *
7c5e268c6Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8c5e268c6Sopenharmony_ci *
9c5e268c6Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10c5e268c6Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11c5e268c6Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12c5e268c6Sopenharmony_ci * See the License for the specific language governing permissions and
13c5e268c6Sopenharmony_ci * limitations under the License.
14c5e268c6Sopenharmony_ci */
15c5e268c6Sopenharmony_ci
16c5e268c6Sopenharmony_ci/**
17c5e268c6Sopenharmony_ci * @addtogroup power
18c5e268c6Sopenharmony_ci * @{
19c5e268c6Sopenharmony_ci *
20c5e268c6Sopenharmony_ci * @brief Provides APIs for performing hibernation/wakeup operations, subscribing to the hibernation/wakeup status,
21c5e268c6Sopenharmony_ci * and managing running locks.
22c5e268c6Sopenharmony_ci * 
23c5e268c6Sopenharmony_ci * After obtaining an object or proxy of this module, the power service can invoke related APIs to perform
24c5e268c6Sopenharmony_ci * hibernation/wakeup operations, subscribe to the hibernation/wakeup status, and manage running locks.
25c5e268c6Sopenharmony_ci *
26c5e268c6Sopenharmony_ci * @since 3.1
27c5e268c6Sopenharmony_ci * @version 1.0
28c5e268c6Sopenharmony_ci */
29c5e268c6Sopenharmony_ci
30c5e268c6Sopenharmony_ci/**
31c5e268c6Sopenharmony_ci * @file IPowerInterface.idl
32c5e268c6Sopenharmony_ci *
33c5e268c6Sopenharmony_ci * @brief Provides APIs for performing hibernation/wakeup operations, subscribing to the hibernation/wakeup status,
34c5e268c6Sopenharmony_ci * and managing running locks.
35c5e268c6Sopenharmony_ci *
36c5e268c6Sopenharmony_ci * 
37c5e268c6Sopenharmony_ci *
38c5e268c6Sopenharmony_ci * @since 3.1
39c5e268c6Sopenharmony_ci * @version 1.0
40c5e268c6Sopenharmony_ci */
41c5e268c6Sopenharmony_ci
42c5e268c6Sopenharmony_cipackage ohos.hdi.power.v1_0;
43c5e268c6Sopenharmony_ci
44c5e268c6Sopenharmony_ciimport ohos.hdi.power.v1_0.IPowerHdiCallback;
45c5e268c6Sopenharmony_ciimport ohos.hdi.power.v1_0.PowerTypes;
46c5e268c6Sopenharmony_ci
47c5e268c6Sopenharmony_ci/**
48c5e268c6Sopenharmony_ci * @brief Represents APIs for performing hibernation/wakeup operations, subscribing to the hibernation/wakeup status,
49c5e268c6Sopenharmony_ci * and managing running locks.
50c5e268c6Sopenharmony_ci *
51c5e268c6Sopenharmony_ci * 
52c5e268c6Sopenharmony_ci *
53c5e268c6Sopenharmony_ci * @since 3.1
54c5e268c6Sopenharmony_ci */
55c5e268c6Sopenharmony_ciinterface IPowerInterface {
56c5e268c6Sopenharmony_ci    /**
57c5e268c6Sopenharmony_ci     * @brief Registers the callback of the hibernation/wakeup status.
58c5e268c6Sopenharmony_ci     *
59c5e268c6Sopenharmony_ci     * @param ipowerHdiCallback Callback to register.
60c5e268c6Sopenharmony_ci     *
61c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
62c5e268c6Sopenharmony_ci     * @see IPowerHdiCallback
63c5e268c6Sopenharmony_ci     *
64c5e268c6Sopenharmony_ci     * @since 3.1
65c5e268c6Sopenharmony_ci     */
66c5e268c6Sopenharmony_ci    RegisterCallback([in] IPowerHdiCallback ipowerHdiCallback);
67c5e268c6Sopenharmony_ci
68c5e268c6Sopenharmony_ci    /**
69c5e268c6Sopenharmony_ci     * @brief Hibernates a device.
70c5e268c6Sopenharmony_ci     *
71c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
72c5e268c6Sopenharmony_ci     *
73c5e268c6Sopenharmony_ci     * @since 3.1
74c5e268c6Sopenharmony_ci     */
75c5e268c6Sopenharmony_ci    StartSuspend();
76c5e268c6Sopenharmony_ci
77c5e268c6Sopenharmony_ci    /**
78c5e268c6Sopenharmony_ci     * @brief Wakes up a device.
79c5e268c6Sopenharmony_ci     *
80c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
81c5e268c6Sopenharmony_ci     *
82c5e268c6Sopenharmony_ci     * @since 3.1
83c5e268c6Sopenharmony_ci     */
84c5e268c6Sopenharmony_ci    StopSuspend();
85c5e268c6Sopenharmony_ci
86c5e268c6Sopenharmony_ci    /**
87c5e268c6Sopenharmony_ci     * @brief Forcibly hibernates a device.
88c5e268c6Sopenharmony_ci     *
89c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
90c5e268c6Sopenharmony_ci     *
91c5e268c6Sopenharmony_ci     * @since 3.1
92c5e268c6Sopenharmony_ci     */
93c5e268c6Sopenharmony_ci    ForceSuspend();
94c5e268c6Sopenharmony_ci
95c5e268c6Sopenharmony_ci    /**
96c5e268c6Sopenharmony_ci     * @brief Enables the running lock to block device hibernation.
97c5e268c6Sopenharmony_ci     *
98c5e268c6Sopenharmony_ci     * @param name Name of the running lock.
99c5e268c6Sopenharmony_ci     *
100c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
101c5e268c6Sopenharmony_ci     *
102c5e268c6Sopenharmony_ci     * @since 3.1
103c5e268c6Sopenharmony_ci     */
104c5e268c6Sopenharmony_ci    SuspendBlock([in] String name);
105c5e268c6Sopenharmony_ci
106c5e268c6Sopenharmony_ci    /**
107c5e268c6Sopenharmony_ci     * @brief Disables the running lock to unblock device hibernation.
108c5e268c6Sopenharmony_ci     *
109c5e268c6Sopenharmony_ci     * @param name Name of the running lock.
110c5e268c6Sopenharmony_ci     *
111c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
112c5e268c6Sopenharmony_ci     *
113c5e268c6Sopenharmony_ci     * @since 3.1
114c5e268c6Sopenharmony_ci     */
115c5e268c6Sopenharmony_ci    SuspendUnblock([in] String name);
116c5e268c6Sopenharmony_ci
117c5e268c6Sopenharmony_ci    /**
118c5e268c6Sopenharmony_ci     * @brief Obtains the power dump information.
119c5e268c6Sopenharmony_ci     *
120c5e268c6Sopenharmony_ci     * @param info Power dump information.
121c5e268c6Sopenharmony_ci     *
122c5e268c6Sopenharmony_ci     * @return Returns <b>HDF_SUCCESS</b> if the operation is successful.
123c5e268c6Sopenharmony_ci     *
124c5e268c6Sopenharmony_ci     * @since 3.1
125c5e268c6Sopenharmony_ci     */
126c5e268c6Sopenharmony_ci    PowerDump([out] String info);
127c5e268c6Sopenharmony_ci}
128c5e268c6Sopenharmony_ci/** @} */
129