diff --git a/en/application-dev/reference/apis/js-apis-system-device.md b/en/application-dev/reference/apis/js-apis-system-device.md index 18c6c703d5e033c216fb47594fa8116fc581dfc6..ea1eadb9ab116dc938190e3356e1c4c73d5ce821 100644 --- a/en/application-dev/reference/apis/js-apis-system-device.md +++ b/en/application-dev/reference/apis/js-apis-system-device.md @@ -16,7 +16,7 @@ import device from '@system.device'; ## device.getInfo -getInfo(Object): void +getInfo(options?: GetDeviceOptions): void Obtains the device information. @@ -30,11 +30,25 @@ Obtains the device information. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| success | Function | No| Called when API call is successful.| -| fail | Function | No| Called when API call has failed.| -| complete | Function | No| Called when API call is complete.| +| options | [GetDeviceOptions](#getdeviceoptions) | No| Parameters for obtaining the device information.| -**Return value of success()** +## 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.
**code:200**: Certain information could not be obtained.| +| complete | () => void| No| Called when API call is complete.| + +## DeviceResponse + +Provides the device information. + +**System capability**: SystemCapability.Startup.SystemInfo | Name| Type| Description| | -------- | -------- | -------- | @@ -49,14 +63,9 @@ Obtains the device information. | screenDensity4+ | number | Screen density.| | screenShape4+ | string | Screen shape. The options are as follows:
- **rect**: rectangular screen
- **circle**: round screen| | apiVersion4+ | number | API version.| -| releaseType4+ | string | Release type. The value includes both the release type and the API version, for example, Beta1.
Available release types are as follows:
- **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.
- **Beta**: For the same API version, different beta releases are compatible with each other, but not compatible with those of the **release** type.
- **Release**: Releases of this type are compatible with the latest five API versions.| +| releaseType4+ | string | Release type. The value includes both the release type and the API version, for example, Beta1.
Available release types are as follows:
- **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.
- **Beta**: Releases of this type are compatible with each other under the same API version, but not with those of the **release** type.
- **Release**: Releases of this type are compatible with the latest five API versions.| | deviceType4+ | string | Device type.| -**Return value of fail()** - -| Error Code| Description| -| -------- | -------- | -| 200 | Certain information cannot be obtained.| **Example**