199552fe9Sopenharmony_ci# Device Standby
299552fe9Sopenharmony_ci## Introduction<a name="section11660541593"></a>
399552fe9Sopenharmony_ciTo improve device endurance and reduce device power consumption, the system will limit the use of resources by backend applications when the device enters a standby idle state. Developers can apply for inclusion in standby resource control for their applications based on their own situation, or temporarily not be controlled by standby resources.
499552fe9Sopenharmony_ci
599552fe9Sopenharmony_ci**Image 1**  Device Standby system structure
699552fe9Sopenharmony_ci
799552fe9Sopenharmony_ci![](figures/zh-en_image.png)
899552fe9Sopenharmony_ci
999552fe9Sopenharmony_ci## Directory Structure<a name="section161941989596"></a>
1099552fe9Sopenharmony_ci
1199552fe9Sopenharmony_ci```
1299552fe9Sopenharmony_ci/foundation/resourceschedule/device_standby
1399552fe9Sopenharmony_ci├── frameworks       # API interface
1499552fe9Sopenharmony_ci├── interfaces
1599552fe9Sopenharmony_ci│   ├── innerkits    # inside interface
1699552fe9Sopenharmony_ci│   └── kits         # outside interface
1799552fe9Sopenharmony_ci├── sa_profile       # component service configruation
1899552fe9Sopenharmony_ci├── services         # service implements
1999552fe9Sopenharmony_ci└── utils            # commone utils
2099552fe9Sopenharmony_ci└── plugins          # plugins(state detection、decision、transition、exection)
2199552fe9Sopenharmony_ci└── bundle.json      # component discription and build file
2299552fe9Sopenharmony_ci```
2399552fe9Sopenharmony_ci
2499552fe9Sopenharmony_ci### Inner Module Introduction<a name="section114564657874"></a>
2599552fe9Sopenharmony_ci
2699552fe9Sopenharmony_ci|Module Name   |Discription    |
2799552fe9Sopenharmony_ci|------------|---------------|
2899552fe9Sopenharmony_ci|interface   |1.provide inner dump function, exemption, notification interfaces. |
2999552fe9Sopenharmony_ci|            |2.provide constraint interfaces. |
3099552fe9Sopenharmony_ci|sa_profile  |config standby service in service management.|
3199552fe9Sopenharmony_ci|services    |1.core services implements. |
3299552fe9Sopenharmony_ci|            |2.notification, search function. |
3399552fe9Sopenharmony_ci|plugins     |1.status detection. |
3499552fe9Sopenharmony_ci|            |2.limit application source decision.| 
3599552fe9Sopenharmony_ci|            |3.change device status.  |
3699552fe9Sopenharmony_ci|            |4.execte strategy|
3799552fe9Sopenharmony_ci|utils       |1.common tools, log ability|
3899552fe9Sopenharmony_ci|            |2.reference configuration |
3999552fe9Sopenharmony_ci|frameworks  |provide Apis.|
4099552fe9Sopenharmony_ci
4199552fe9Sopenharmony_ci## Device Standby<a name="section1312121216216"></a>
4299552fe9Sopenharmony_ci
4399552fe9Sopenharmony_ci|Interface   |Discription    |
4499552fe9Sopenharmony_ci|------------|---------------|
4599552fe9Sopenharmony_ci|function getExemptedApps(resourceTypes: number, callback: AsyncCallback<Array&lt;ExemptedAppInfo&gt;>): void; |Returns the information about the specified exempted application. |
4699552fe9Sopenharmony_ci|function getExemptedApps(resourceTypes: number): Promise<Array&lt;ExemptedAppInfo&gt;>; |Returns the information about the specified exempted application. |
4799552fe9Sopenharmony_ci|function requestExemptionResource(request: ResourceRequest): void; |Requests exemption resources.|
4899552fe9Sopenharmony_ci|function releaseExemptionResource(request: ResourceRequest): void; |Releases exemption resources.|
4999552fe9Sopenharmony_ci
5099552fe9Sopenharmony_ci## Usage Guidelines<a name="section114564657874"></a>
5199552fe9Sopenharmony_ci
5299552fe9Sopenharmony_ciWhen the device application is not used for a long time or by pressing a button, this component can put the device application into standby mode. Standby mode does not affect application usage and can also extend battery life. Through this module interface, developers can apply for or cancel standby resource control for applications. Before using these apis, please apply permission first: ohos.permission.DEVICE_STANDBY_EXEMPTION.
5399552fe9Sopenharmony_ci
5499552fe9Sopenharmony_ci### ResourceType
5599552fe9Sopenharmony_ci
5699552fe9Sopenharmony_ciThe type of exemption resources requested by the application.
5799552fe9Sopenharmony_ci
5899552fe9Sopenharmony_ci|Name   |Value   |Discription|
5999552fe9Sopenharmony_ci| ------------ | ------------ |--------------|
6099552fe9Sopenharmony_ci|NETWORK    |1   |The resource for non-standby network access.|
6199552fe9Sopenharmony_ci|RUNNING_LOCK    |2   |The resource for non-standby cpu running-lock.|
6299552fe9Sopenharmony_ci|TIMER     |4   |The resource for non-standby timer.|
6399552fe9Sopenharmony_ci|WORK_SCHEDULER     |8   |The resource for non-standby workscheduler.|
6499552fe9Sopenharmony_ci|AUTO_SYNC      |16   |The resource for non-standby automatic synchronization.|
6599552fe9Sopenharmony_ci|PUSH     |32   |The resource for non-standby push-kit.|
6699552fe9Sopenharmony_ci|FREEZE       |64   |The resource for non-standby freezing application.|
6799552fe9Sopenharmony_ci
6899552fe9Sopenharmony_ci### ExemptedAppInfo 
6999552fe9Sopenharmony_ci
7099552fe9Sopenharmony_ciInformation about an exempted application.
7199552fe9Sopenharmony_ci
7299552fe9Sopenharmony_ci|Name  |Type   | Required   |Discription   |
7399552fe9Sopenharmony_ci| ------------ | ------------ |------------ | ------------ |
7499552fe9Sopenharmony_ci|[resourceTypes](#resourcetype)   | number  | Yes   |The set of resource types that an application requests.   |
7599552fe9Sopenharmony_ci|name   |string   | Yes   |  The application name.  |
7699552fe9Sopenharmony_ci|duration   | number  | Yes   | The exemption duration. |
7799552fe9Sopenharmony_ci
7899552fe9Sopenharmony_ci### ResourceRequest
7999552fe9Sopenharmony_ci
8099552fe9Sopenharmony_ciThe request of standby resources.
8199552fe9Sopenharmony_ci
8299552fe9Sopenharmony_ci|Name  |Type   | Required   |Discription   |
8399552fe9Sopenharmony_ci| ------------ | ------------ |------------| ------------ |
8499552fe9Sopenharmony_ci|[resourceTypes](#resourcetype)   | number  | Yes   |The set of resource types that an application requests.|
8599552fe9Sopenharmony_ci|uid   | number  | Yes   |The application uid.|
8699552fe9Sopenharmony_ci|name   |string   | Yes   |The application name.|
8799552fe9Sopenharmony_ci|duration   | number  | Yes   |The exemption duration.|
8899552fe9Sopenharmony_ci|reason   |string   | Yes   |The reason for the request.|
8999552fe9Sopenharmony_ci
9099552fe9Sopenharmony_ci## Repositories Involved<a name="section1371113476307"></a>
9199552fe9Sopenharmony_ci
9299552fe9Sopenharmony_ciResource Schedule subsystem
9399552fe9Sopenharmony_ci
9499552fe9Sopenharmony_ci[**resourceschedule_device_standby**](https://gitee.com/openharmony/resourceschedule_device_standby)
9599552fe9Sopenharmony_ci
9699552fe9Sopenharmony_ci[resourceschedule_work_scheduler](https://gitee.com/openharmony/resourceschedule_work_scheduler)
9799552fe9Sopenharmony_ci
9899552fe9Sopenharmony_ci[notification_ces_standard](https://gitee.com/openharmony/notification_ces_standard)
9999552fe9Sopenharmony_ci
10099552fe9Sopenharmony_ci[appexecfwk_standard](https://gitee.com/openharmony/appexecfwk_standard)
10199552fe9Sopenharmony_ci
10299552fe9Sopenharmony_ci[powermgr_battery_manager](https://gitee.com/openharmony/powermgr_battery_manager)
10399552fe9Sopenharmony_ci
10499552fe9Sopenharmony_ci[resourceschedule_background_task_mgr](https://gitee.com/openharmony/resourceschedule_background_task_mgr)