提交 7f05577a 编写于 作者: G Gloria

Update docs against 16080+16151+16197+16202

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 826466f7
......@@ -290,7 +290,7 @@ Obtains the information about a given mission. This API uses an asynchronous cal
| -------- | -------- | -------- | -------- |
| deviceId | string | Yes| Device ID. It is a null string by default for the local device.|
| missionId | number | Yes| Mission ID.|
| callback | AsyncCallback&lt;[MissionInfo](./js-apis-inner-application-missionInfo.md))&gt; | Yes| Callback used to return the mission information obtained.|
| callback | AsyncCallback&lt;[MissionInfo](./js-apis-inner-application-missionInfo.md)&gt; | Yes| Callback used to return the mission information obtained.|
**Example**
......
......@@ -3741,7 +3741,7 @@ Subscribes to playlist item changes.
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------- | ---- | ---------------------------------------------------------------------------- |
| type | string | Yes | Event type. The event **'queueItemsChange'** is reported when one or more items in the playlist changes.|
| callback | (items: Array<[AVQueueItem](#avqueueitem10)\>) => void | Yes | Callback used for subscription. **items** in the callback indicates the names of the items that change, and **args** indicates the parameters carried in the event. |
| callback | (items: Array<[AVQueueItem](#avqueueitem10)\>) => void | Yes | Callback used for subscription. The **items** parameter in the callback indicates the changed items in the playlist. |
**Error codes**
......@@ -3775,7 +3775,7 @@ Subscribes to playlist name changes.
| Name | Type | Mandatory| Description |
| -------- | ----------------------- | ---- | ------------------------------------------------------------------------------- |
| type | string | Yes | Event type. The event **'queueTitleChange'** is reported when the playlist name changes.|
| callback | (title: string) => void | Yes | Callback used for subscription. **items** in the callback indicates the name of the playlist that changes, and **args** indicates the parameters carried in the event. |
| callback | (title: string) => void | Yes | Callback used for subscription. The **title** parameter in the callback indicates the changed playlist name. |
**Error codes**
......
......@@ -96,7 +96,7 @@ Enumerates the device types.
| CAR | 0x83 | Car. |
| UNKNOWN_TYPE | 0 | Unknown device type.|
## AuthForm
## AuthForm<sup>10+</sup>
Enumerates the device authentication types.
......@@ -262,8 +262,6 @@ getTrustedDeviceListSync(): Array&lt;DeviceInfo&gt;
Obtains all trusted devices synchronously.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Return value**
......@@ -296,8 +294,6 @@ getTrustedDeviceList(callback:AsyncCallback&lt;Array&lt;DeviceInfo&gt;&gt;): voi
Obtains all trusted devices. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -336,8 +332,6 @@ getTrustedDeviceList(): Promise&lt;Array&lt;DeviceInfo&gt;&gt;
Obtains all trusted devices. This API uses a promise to return the result.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Return value**
......@@ -370,8 +364,6 @@ getLocalDeviceInfoSync(): [DeviceInfo](#deviceinfo)
Obtains local device information synchronously.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Return value**
......@@ -404,8 +396,6 @@ getLocalDeviceInfo(callback:AsyncCallback&lt;DeviceInfo&gt;): void
Obtains local device information. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -444,8 +434,6 @@ getLocalDeviceInfo(): Promise&lt;DeviceInfo&gt;
Obtains local device information. This API uses a promise to return the result.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Return value**
......@@ -478,8 +466,6 @@ startDeviceDiscovery(subscribeInfo: SubscribeInfo): void
Starts to discover peripheral devices.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -524,8 +510,6 @@ startDeviceDiscovery(subscribeInfo: SubscribeInfo, filterOptions?: string): void
Starts to discover peripheral devices and filters discovered devices.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -580,8 +564,6 @@ stopDeviceDiscovery(subscribeId: number): void
Stops device discovery.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -616,8 +598,6 @@ publishDeviceDiscovery(publishInfo: PublishInfo): void
Publishes device information for discovery purposes.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -659,8 +639,6 @@ unPublishDeviceDiscovery(publishId: number): void
Stops publishing device information.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -695,8 +673,6 @@ authenticateDevice(deviceInfo: DeviceInfo, authParam: AuthParam, callback: Async
Authenticates a device.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -757,8 +733,6 @@ unAuthenticateDevice(deviceInfo: DeviceInfo): void
Deauthenticates a device.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -798,8 +772,6 @@ verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback&lt;{deviceId: string,
Verifies authentication information.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -844,8 +816,6 @@ setUserOperation(operateAction: number, params: string): void;
Sets a user operation.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -880,8 +850,6 @@ requestCredentialRegisterInfo(requestInfo: string, callback: AsyncCallback<{regi
Obtains the registration information of the credential.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -917,8 +885,6 @@ importCredential(credentialInfo: string, callback: AsyncCallback<{resultInfo: st
Imports credential information.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -970,8 +936,6 @@ deleteCredential(queryInfo: string, callback: AsyncCallback<{resultInfo: string}
Deletes credential information.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -1008,8 +972,6 @@ on(type: 'uiStateChange', callback: Callback&lt;{ param: string}&gt;): void;
Subscribes to UI status changes.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -1040,8 +1002,6 @@ off(type: 'uiStateChange', callback?: Callback&lt;{ param: string}&gt;): void;
Unsubscribes from UI status changes.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -1067,8 +1027,6 @@ on(type: 'deviceStateChange', callback: Callback&lt;{ action: DeviceStateChange
Subscribes to changes in the device state.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -1096,8 +1054,6 @@ off(type: 'deviceStateChange', callback?: Callback&lt;{ action: DeviceStateChang
Unsubscribes from changes in the device state.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -1125,8 +1081,6 @@ on(type: 'deviceFound', callback: Callback&lt;{ subscribeId: number, device: Dev
Subscribes to device discovery events.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -1154,8 +1108,6 @@ off(type: 'deviceFound', callback?: Callback&lt;{ subscribeId: number, device: D
Unsubscribes from device discovery events.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -1183,8 +1135,6 @@ on(type: 'discoverFail', callback: Callback&lt;{ subscribeId: number, reason: nu
Subscribes to device discovery failures.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -1212,8 +1162,6 @@ off(type: 'discoverFail', callback?: Callback&lt;{ subscribeId: number, reason:
Unsubscribes from device discovery failures.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -1241,8 +1189,6 @@ on(type: 'publishSuccess', callback: Callback&lt;{ publishId: number }&gt;): voi
Subscribes to device information publication success events.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -1271,8 +1217,6 @@ off(type: 'publishSuccess', callback?: Callback&lt;{ publishId: number }&gt;): v
Unsubscribes from device information publication success events.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -1300,8 +1244,6 @@ on(type: 'publishFail', callback: Callback&lt;{ publishId: number, reason: numbe
Subscribes to device information publication failures.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -1329,8 +1271,6 @@ off(type: 'publishFail', callback?: Callback&lt;{ publishId: number, reason: num
Unsubscribes from device information publication failures.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -1358,8 +1298,6 @@ on(type: 'serviceDie', callback: () =&gt; void): void
Subscribes to dead events of the **DeviceManager** service.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......@@ -1387,8 +1325,6 @@ off(type: 'serviceDie', callback?: () =&gt; void): void
Unsubscribes from dead events of the **DeviceManager** service.
**Required permissions**: ohos.permission.ACCESS_SERVICE_DM (available only to system applications)
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
......
......@@ -40,11 +40,9 @@ Defines the data structure of the fault log information.
| summary | string | Yes| Summary of the fault.|
| fullLog | string | Yes| Full log text.|
## faultLogger.querySelfFaultLog<sup>(deprecated)</sup>
querySelfFaultLog(faultType: FaultType, callback: AsyncCallback&lt;Array&lt;FaultLogInfo&gt;&gt;) : void
## faultLogger.query<sup>9+</sup>
> **NOTE**<br>This API is deprecated since API version 9. You are advised to use [faultLogger.query](#faultloggerquery9) instead.
query(faultType: FaultType, callback: AsyncCallback&lt;Array&lt;FaultLogInfo&gt;&gt;) : void
Obtains the fault information about the current process. This API uses an asynchronous callback to return the fault information array obtained, which contains a maximum of 10 pieces of fault information.
......@@ -57,6 +55,14 @@ Obtains the fault information about the current process. This API uses an asynch
| faultType | [FaultType](#faulttype) | Yes| Fault type.|
| callback | AsyncCallback&lt;Array&lt;[FaultLogInfo](#faultloginfo)&gt;&gt; | Yes| Callback used to return the fault information array.<br>The value is the fault information array obtained. If the value is **undefined**, an exception occurs during the information retrieval. In this case, an error string will be returned.
**Error codes**
For details about the error codes, see [FaultLogger Error Codes](../errorcodes/errorcode-faultlogger.md).
| ID| Error Message|
| --- | --- |
| 10600001 | The service is not started or is faulty |
**Example**
```js
......@@ -79,14 +85,16 @@ function queryFaultLogCallback(error, value) {
}
}
}
faultLogger.querySelfFaultLog(faultLogger.FaultType.JS_CRASH, queryFaultLogCallback);
try {
faultLogger.query(faultLogger.FaultType.JS_CRASH, queryFaultLogCallback);
} catch (err) {
console.error(`code: ${err.code}, message: ${err.message}`);
}
```
## faultLogger.querySelfFaultLog<sup>(deprecated)</sup>
querySelfFaultLog(faultType: FaultType) : Promise&lt;Array&lt;FaultLogInfo&gt;&gt;
## faultLogger.query<sup>9+</sup>
> **NOTE**<br>This API is deprecated since API version 9. You are advised to use [faultLogger.query](#faultloggerquery9-1) instead.
query(faultType: FaultType) : Promise&lt;Array&lt;FaultLogInfo&gt;&gt;
Obtains the fault information about the current process. This API uses a promise to return the fault information array obtained, which contains a maximum of 10 pieces of fault information.
......@@ -104,32 +112,48 @@ Obtains the fault information about the current process. This API uses a promise
| -------- | -------- |
| Promise&lt;Array&lt;[FaultLogInfo](#faultloginfo)&gt;&gt; | Promise used to return the fault information array. You can obtain the fault information instance in its **then()** method or use **await**.<br>The value is the fault information array obtained. If the value is **undefined**, an exception occurs during the information retrieval.|
**Error codes**
For details about the error codes, see [FaultLogger Error Codes](../errorcodes/errorcode-faultlogger.md).
| ID| Error Message|
| --- | --- |
| 10600001 | The service is not started or is faulty |
**Example**
```js
async function getLog() {
let value = await faultLogger.querySelfFaultLog(faultLogger.FaultType.JS_CRASH);
if (value) {
console.info("value length is " + value.length);
let len = value.length;
for (let i = 0; i < len; i++) {
console.info("log: " + i);
console.info("Log pid: " + value[i].pid);
console.info("Log uid: " + value[i].uid);
console.info("Log type: " + value[i].type);
console.info("Log timestamp: " + value[i].timestamp);
console.info("Log reason: " + value[i].reason);
console.info("Log module: " + value[i].module);
console.info("Log summary: " + value[i].summary);
console.info("Log text: " + value[i].fullLog);
try {
let value = await faultLogger.query(faultLogger.FaultType.JS_CRASH);
if (value) {
console.info("value length is " + value.length);
let len = value.length;
for (let i = 0; i < len; i++) {
console.info("log: " + i);
console.info("Log pid: " + value[i].pid);
console.info("Log uid: " + value[i].uid);
console.info("Log type: " + value[i].type);
console.info("Log timestamp: " + value[i].timestamp);
console.info("Log reason: " + value[i].reason);
console.info("Log module: " + value[i].module);
console.info("Log summary: " + value[i].summary);
console.info("Log text: " + value[i].fullLog);
}
}
} catch (err) {
console.error(`code: ${err.code}, message: ${err.message}`);
}
}
```
## faultLogger.query<sup>9+</sup>
## faultLogger.querySelfFaultLog<sup>(deprecated)</sup>
query(faultType: FaultType, callback: AsyncCallback&lt;Array&lt;FaultLogInfo&gt;&gt;) : void
querySelfFaultLog(faultType: FaultType, callback: AsyncCallback&lt;Array&lt;FaultLogInfo&gt;&gt;) : void
> **NOTE**
>
> This API is deprecated since API version 9. You are advised to use [faultLogger.query](#faultloggerquery9) instead.
Obtains the fault information about the current process. This API uses an asynchronous callback to return the fault information array obtained, which contains a maximum of 10 pieces of fault information.
......@@ -142,14 +166,6 @@ Obtains the fault information about the current process. This API uses an asynch
| faultType | [FaultType](#faulttype) | Yes| Fault type.|
| callback | AsyncCallback&lt;Array&lt;[FaultLogInfo](#faultloginfo)&gt;&gt; | Yes| Callback used to return the fault information array.<br>The value is the fault information array obtained. If the value is **undefined**, an exception occurs during the information retrieval. In this case, an error string will be returned.
**Error codes**
For details about the error codes, see [FaultLogger Error Codes](../errorcodes/errorcode-faultlogger.md).
| ID| Error Message|
| --- | --- |
| 10600001 | The service is not started or is faulty |
**Example**
```js
......@@ -172,16 +188,16 @@ function queryFaultLogCallback(error, value) {
}
}
}
try {
faultLogger.query(faultLogger.FaultType.JS_CRASH, queryFaultLogCallback);
} catch (err) {
console.error(`code: ${err.code}, message: ${err.message}`);
}
faultLogger.querySelfFaultLog(faultLogger.FaultType.JS_CRASH, queryFaultLogCallback);
```
## faultLogger.query<sup>9+</sup>
## faultLogger.querySelfFaultLog<sup>(deprecated)</sup>
query(faultType: FaultType) : Promise&lt;Array&lt;FaultLogInfo&gt;&gt;
querySelfFaultLog(faultType: FaultType) : Promise&lt;Array&lt;FaultLogInfo&gt;&gt;
> **NOTE**
>
> This API is deprecated since API version 9. You are advised to use [faultLogger.query](#faultloggerquery9-1) instead.
Obtains the fault information about the current process. This API uses a promise to return the fault information array obtained, which contains a maximum of 10 pieces of fault information.
......@@ -199,37 +215,25 @@ Obtains the fault information about the current process. This API uses a promise
| -------- | -------- |
| Promise&lt;Array&lt;[FaultLogInfo](#faultloginfo)&gt;&gt; | Promise used to return the fault information array. You can obtain the fault information instance in its **then()** method or use **await**.<br>The value is the fault information array obtained. If the value is **undefined**, an exception occurs during the information retrieval.|
**Error codes**
For details about the error codes, see [FaultLogger Error Codes](../errorcodes/errorcode-faultlogger.md).
| ID| Error Message|
| --- | --- |
| 10600001 | The service is not started or is faulty |
**Example**
```js
async function getLog() {
try {
let value = await faultLogger.query(faultLogger.FaultType.JS_CRASH);
if (value) {
console.info("value length is " + value.length);
let len = value.length;
for (let i = 0; i < len; i++) {
console.info("log: " + i);
console.info("Log pid: " + value[i].pid);
console.info("Log uid: " + value[i].uid);
console.info("Log type: " + value[i].type);
console.info("Log timestamp: " + value[i].timestamp);
console.info("Log reason: " + value[i].reason);
console.info("Log module: " + value[i].module);
console.info("Log summary: " + value[i].summary);
console.info("Log text: " + value[i].fullLog);
}
let value = await faultLogger.querySelfFaultLog(faultLogger.FaultType.JS_CRASH);
if (value) {
console.info("value length is " + value.length);
let len = value.length;
for (let i = 0; i < len; i++) {
console.info("log: " + i);
console.info("Log pid: " + value[i].pid);
console.info("Log uid: " + value[i].uid);
console.info("Log type: " + value[i].type);
console.info("Log timestamp: " + value[i].timestamp);
console.info("Log reason: " + value[i].reason);
console.info("Log module: " + value[i].module);
console.info("Log summary: " + value[i].summary);
console.info("Log text: " + value[i].fullLog);
}
} catch (err) {
console.error(`code: ${err.code}, message: ${err.message}`);
}
}
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册