• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 BATTERTMGR_UTILS_BATTERY_HOOKMGR_H
17 #define BATTERTMGR_UTILS_BATTERY_HOOKMGR_H
18 
19 #include <cstdint>
20 #include <hookmgr.h>
21 #include <modulemgr.h>
22 #include <string>
23 #include "battery_info.h"
24 
25 namespace OHOS {
26 namespace PowerMgr {
27 enum class BatteryHookStage : int32_t {
28     BATTERY_UEVENT_CHECK = 0,
29     BATTERY_PUBLISH_EVENT,
30     BATTERY_HOOK_STAGE_MAX = 1000,
31 };
32 
33 typedef struct UeventCheckInfo {
34     std::string UeventName;
35     bool checkResult;
36 } UEVENT_CHECK_INFO;
37 
38 struct PublishEventContext {
39     BatteryPluggedType pluggedType;
40     BatteryPluggedType lastPluggedType;
41     bool wirelessChargerEnable;
42 };
43 
44 HOOK_MGR* GetBatteryHookMgr();
45 } // namespace PowerMgr
46 } // namespace OHOS
47 
48 #endif // BATTERTMGR_UTILS_BATTERY_HOOKMGR_H