提交 3eb5f273 编写于 作者: S shawn_he

update docs

Signed-off-by: Nshawn_he <shawn.he@huawei.com>
上级 15c66a99
# Thermal Management # Thermal Manager
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
The Thermal Manager module provides APIs for listening to the device thermal status.
## Modules to Import ## Modules to Import
...@@ -15,15 +17,15 @@ import thermal from '@ohos.thermal'; ...@@ -15,15 +17,15 @@ import thermal from '@ohos.thermal';
Represents the thermal level. Represents the thermal level.
| Name| Default Value| Description| | Name | Default Value | Description |
| -------- | -------- | -------- | | ---------- | ---- | ---------------------------------------- |
| COOL | 0 | The device is cool, and services are not restricted.| | COOL | 0 | The device is cool, and services are not restricted.<br>**System capability:** SystemCapability.PowerManager.ThermalManager|
| NORMAL | 1 | The device is operational but is not cool. You need to pay attention to its heating.| | NORMAL | 1 | The device is operational but is not cool. You need to pay attention to its heating.<br>**System capability:** SystemCapability.PowerManager.ThermalManager|
| WARM | 2 | The device is warm. You need to stop or delay some imperceptible services.| | WARM | 2 | The device is warm. You need to stop or delay some imperceptible services.<br>**System capability:** SystemCapability.PowerManager.ThermalManager|
| HOT | 3 | The device is heating up. You need to stop all imperceptible services and downgrade or reduce the load of other services.| | HOT | 3 | The device is heating up. You need to stop all imperceptible services and downgrade or reduce the load of other services.<br>**System capability:** SystemCapability.PowerManager.ThermalManager|
| OVERHEATED | 4 | The device is overheated. You need to stop all imperceptible services and downgrade or reduce the load of major services.| | OVERHEATED | 4 | The device is overheated. You need to stop all imperceptible services and downgrade or reduce the load of major services.<br>**System capability:** SystemCapability.PowerManager.ThermalManager|
| WARNING | 5 | The device is overheated and is about to enter the emergency state. You need to stop all imperceptible services and downgrade major services to the maximum extent.| | WARNING | 5 | The device is overheated and is about to enter the emergency state. You need to stop all imperceptible services and downgrade major services to the maximum extent.<br>**System capability:** SystemCapability.PowerManager.ThermalManager|
| EMERGENCY | 6 | The device has entered the emergency state. You need to stop all services except those for the emergency help purposes.| | EMERGENCY | 6 | The device has entered the emergency state. You need to stop all services except those for the emergency help purposes.<br>**System capability:** SystemCapability.PowerManager.ThermalManager|
## thermal.subscribeThermalLevel ## thermal.subscribeThermalLevel
...@@ -32,19 +34,18 @@ subscribeThermalLevel(callback: AsyncCallback&lt;ThermalLevel&gt;): void ...@@ -32,19 +34,18 @@ subscribeThermalLevel(callback: AsyncCallback&lt;ThermalLevel&gt;): void
Subscribes to thermal level changes. Subscribes to thermal level changes.
**System Capabilities** **System capability:** SystemCapability.PowerManager.ThermalManager
SystemCapability.PowerManager.ThermalManager
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | --------------------------------- | ---- | ---------------------------------------- |
| callback | AsyncCallback&lt;ThermalLevel&gt; | Yes| Callback used to obtain the return value. <br/>Return value: thermal level| | callback | AsyncCallback&lt;ThermalLevel&gt; | Yes | Callback used to obtain the return value.<br>Return value: thermal level|
**Example** **Example**
``` ```
var lev = 0;
thermal.subscribeThermalLevel((lev) => { thermal.subscribeThermalLevel((lev) => {
console.info("Thermal level is: " + lev); console.info("Thermal level is: " + lev);
}) })
...@@ -52,19 +53,17 @@ thermal.subscribeThermalLevel((lev) => { ...@@ -52,19 +53,17 @@ thermal.subscribeThermalLevel((lev) => {
## thermal.unsubscribeThermalLevel ## thermal.unsubscribeThermalLevel
unsubscribeThermalLevel(callback?: AsyncCallback<void>): void unsubscribeThermalLevel(callback?: AsyncCallback\<void>): void
Unsubscribes from thermal level changes. Unsubscribes from thermal level changes.
**System Capabilities** **System capability:** SystemCapability.PowerManager.ThermalManager
SystemCapability.PowerManager.ThermalManager
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- | | -------- | ------------------------- | ---- | --------------------- |
| callback | AsyncCallback&lt;void&gt; | No| Callback without a return value.| | callback | AsyncCallback&lt;void&gt; | No | Callback without a return value.|
**Example** **Example**
...@@ -80,14 +79,12 @@ getThermalLevel(): ThermalLevel ...@@ -80,14 +79,12 @@ getThermalLevel(): ThermalLevel
Obtains the current thermal level. Obtains the current thermal level.
**System Capabilities** **System capability:** SystemCapability.PowerManager.ThermalManager
SystemCapability.PowerManager.ThermalManager
**Return value** **Return value**:
| Type| Description| | Type | Description |
| -------- | -------- | | ------------ | ------ |
| ThermalLevel | Thermal level obtained.| | ThermalLevel | Thermal level obtained.|
**Example** **Example**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册