5 Star 54 Fork 87

OpenHarmony / powermgr_powermgr_lite

Create your Gitee Account
Explore and code with more than 8 million developers,Free private repositories !:)
Sign up
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

Lite Power Manager

Introduction

The lite power manager provides the following capabilities:

  1. Managing sleep and wakeup locks.
  2. Keeping the device screen always on using a lock

Figure 1 Lite power manager architecture

Directory Structure

base/powermgr/powermgr_lite
├── figures           # Architecture figures
├── frameworks        # Frameworks
│   ├── include       # Header files
│   └── src           # Source files
├── interfaces        # APIs
│   ├── innerkits     # Internal APIs
│   └── kits          # External APIs
├── services          # Services
│   ├── include       # Header files
│   └── src           # Source files
└── utils             # Utilities
    ├── include       # Header files
    └── src           # Source files

Usage

Available APIs

The following table lists the JavaScript APIs provided by the lite power manager.

API

Description

RunningLock *CreateRunningLock(const char *name, RunningLockType type, RunningLockFlag flag)

Creates a Runninglock object.

void DestroyRunningLock(const RunningLock *lock)

Destroys an Runninglock object.

BOOL AcquireRunningLock(const RunningLock *lock)

Obtains a Runninglock object.

BOOL ReleaseRunningLock(const RunningLock *lock)

Releases a Runninglock object.

Usage Guidelines

Runninglock Management

The lite power manager provides APIs to create, obtain, and release Runninglock objects.

The sample code is as follows:

const RunningLock *lock = CreateRunningLock("runinglock_example", RUNNINGLOCK_BACKGROUND, RUNNINGLOCK_FLAG_NONE);
if (lock == NULL) {
   return;
}
BOOL ret = AcquireRunningLock(lock);
if (ret == FLASE) {
   DestroyRunningLock(lock);
   return;
}
ReleaseRunningLock(lock);
DestroyRunningLock(lock); // Must release runninglock before destroyed

Repositories Involved

Power management subsystem

powermgr_power_manager

powermgr_display_manager

powermgr_battery_manager

powermgr_thermal_manager

powermgr_battery_statistics

powermgr_battery_lite

powermgr_powermgr_lite

Repository Comments ( 0 )

Sign in to post a comment

About

Power manager for LiteOS | 轻鸿蒙电源管理服务 expand collapse
C and 3 more languages
Apache-2.0
Cancel

Releases

No release

OpenHarmony

Contributors

All

Activities

Load More
can not load any more
1
https://git.oschina.net/openharmony/powermgr_powermgr_lite.git
git@git.oschina.net:openharmony/powermgr_powermgr_lite.git
openharmony
powermgr_powermgr_lite
powermgr_powermgr_lite
master

Search