提交 2ccfe881 编写于 作者: E ester.zhou

Update doc (16288)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 19363dee
# @system.device # @system.device (Device Information)
The **device** module provides APIs for checking information about the current device. The **device** module provides APIs for checking information about the current device.
> **NOTE** > **NOTE**
>
> - The APIs of this module are no longer maintained since API version 6. It is recommended that you use [@ohos.deviceInfo](js-apis-device-info.md) instead. > - The APIs of this module are no longer maintained since API version 6. It is recommended that you use [@ohos.deviceInfo](js-apis-device-info.md) instead.
> >
> - The initial APIs of this module are supported since API version 3. 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 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...@@ -15,7 +16,7 @@ import device from '@system.device'; ...@@ -15,7 +16,7 @@ import device from '@system.device';
## device.getInfo ## device.getInfo
getInfo(Object): void getInfo(options?: GetDeviceOptions): void
Obtains the device information. Obtains the device information.
...@@ -29,33 +30,42 @@ Obtains the device information. ...@@ -29,33 +30,42 @@ Obtains the device information.
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| success | Function | No| Called when API call is successful.| | options | [GetDeviceOptions](#getdeviceoptions) | No| Parameters for obtaining the device information.|
| fail | Function | No| Called when API call has failed.|
| complete | Function | No| Called when API call is complete.| ## GetDeviceOptions
Defines the parameters for obtaining the device information.
**System capability**: SystemCapability.Startup.SystemInfo
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| success | (data: DeviceResponse)=> void| No| Called when API call is successful. **data** indicates the returned device information. For details, see [DeviceResponse](#deviceresponse).|
| fail | (data: any,code:number)=> void| No| Called when API call has failed. **code** indicates the error code returned upon a failure.<br>**code:200**: Certain information could not be obtained.|
| complete | () => void| No| Called when API call is complete.|
## DeviceResponse
**Return value of success()** Provides the device information.
**System capability**: SystemCapability.Startup.SystemInfo
| Name| Type| Description| | Name| Type| Description|
| -------- | -------- | -------- | | -------- | -------- | -------- |
| brand | string | Brand.| | brand | string | Brand.|
| manufacturer | string | Manufacturer.| | manufacturer | string | Manufacturer.|
| model | string | Model. | | model | string | Model.|
| product | string | Product number.| | product | string | Product number.|
| language<sup>4+</sup> | string | System language.| | language<sup>4+</sup> | string | System language.|
| region<sup>4+</sup> | string | System region.| | region<sup>4+</sup> | string | System region.|
| windowWidth | number | Window width.| | windowWidth | number | Window width.|
| windowHeight | number | Window height.| | windowHeight | number | Window height.|
| screenDensity<sup>4+</sup> | number | Screen density.| | screenDensity<sup>4+</sup> | number | Screen density.|
| screenShape<sup>4+</sup> | string | Screen shape. The options are as follows:<br>- **rect**: rectangle screen<br>- **circle**: circle screen| | screenShape<sup>4+</sup> | string | Screen shape. The options are as follows:<br>- **rect**: rectangular screen<br>- **circle**: round screen|
| apiVersion<sup>4+</sup> | number | API version.| | apiVersion<sup>4+</sup> | number | API version.|
| releaseType<sup>4+</sup> | string | Release type. The value includes both the release type and the API version, for example, Beta1.<br>Available release types are as follows:<br>- **Canary**: For the same API version, different canary releases are compatible with each other, but not compatible with those of the **beta** and **release** type.<br>- **Beta**: For the same API version, different beta releases are compatible with each other, but not compatible with those of the **release** type.<br>- **Release**: Releases of this type are compatible with the latest five API versions.| | releaseType<sup>4+</sup> | string | Release type. The value includes both the release type and the API version, for example, Beta1.<br>Available release types are as follows:<br>- **Canary**: Releases of this type are compatible with each other under the same API version, but not with those of the **beta** and **release** type.<br>- **Beta**: Releases of this type are compatible with each other under the same API version, but not with those of the **release** type.<br>- **Release**: Releases of this type are compatible with the latest five API versions. |
| deviceType<sup>4+</sup> | string | Device type.| | deviceType<sup>4+</sup> | string | Device type.|
**Return value of fail()**
| Error Code| Description|
| -------- | -------- |
| 200 | The returned result contains information that cannot be obtained.|
**Example** **Example**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册