提交 4de2a339 编写于 作者: D du-zhihai

DMS开发者资料整改

Signed-off-by: Ndu-zhihai <duzhihai@huawei.com>
Change-Id: I84862437b581ddcbb42e409d8031b256a31827fe
上级 477ba986
...@@ -55,6 +55,7 @@ continuationManager作为流转能力的入口,主要用于拉起系统中的 ...@@ -55,6 +55,7 @@ continuationManager作为流转能力的入口,主要用于拉起系统中的
```ts ```ts
import abilityAccessCtrl from "@ohos.abilityAccessCtrl"; import abilityAccessCtrl from "@ohos.abilityAccessCtrl";
import bundle from '@ohos.bundle'; import bundle from '@ohos.bundle';
import featureAbility from '@ohos.ability.featureAbility';
async function requestPermission() { async function requestPermission() {
let permissions: Array<string> = [ let permissions: Array<string> = [
...@@ -122,7 +123,8 @@ continuationManager作为流转能力的入口,主要用于拉起系统中的 ...@@ -122,7 +123,8 @@ continuationManager作为流转能力的入口,主要用于拉起系统中的
// 如果未申请该权限,则需要调用requestPermissionsFromUser接口申请权限 // 如果未申请该权限,则需要调用requestPermissionsFromUser接口申请权限
if (needGrantPermission) { if (needGrantPermission) {
try { try {
await globalThis.abilityContext.requestPermissionsFromUser(permissions); // globalThis.context即Ability.context,需提前在MainAbility.ts文件中赋值
await globalThis.context.requestPermissionsFromUser(permissions);
} catch (err) { } catch (err) {
console.error('app permission request permissions error' + JSON.stringify(err)); console.error('app permission request permissions error' + JSON.stringify(err));
} }
......
...@@ -30,6 +30,16 @@ register(callback: AsyncCallback\<number>): void; ...@@ -30,6 +30,16 @@ register(callback: AsyncCallback\<number>): void;
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback\<number> | 是 | AsyncCallback形式返回流转管理服务连接后生成的token。 | | callback | AsyncCallback\<number> | 是 | AsyncCallback形式返回流转管理服务连接后生成的token。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 3 | Failed to flatten the object. |
| 7 | The object is null. |
| 29360207 | The maximum number of registrations exceeded. |
**示例:** **示例:**
```ts ```ts
...@@ -61,6 +71,17 @@ register(options: ContinuationExtraParams, callback: AsyncCallback\<number>): vo ...@@ -61,6 +71,17 @@ register(options: ContinuationExtraParams, callback: AsyncCallback\<number>): vo
| options | [ContinuationExtraParams](js-apis-continuation-continuationExtraParams.md) | 是 | 过滤可选择设备列表的额外参数。 | | options | [ContinuationExtraParams](js-apis-continuation-continuationExtraParams.md) | 是 | 过滤可选择设备列表的额外参数。 |
| callback | AsyncCallback\<number> | 是 | AsyncCallback形式返回流转管理服务连接后生成的token。 | | callback | AsyncCallback\<number> | 是 | AsyncCallback形式返回流转管理服务连接后生成的token。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 3 | Failed to flatten the object. |
| 7 | The object is null. |
| 29360207 | The maximum number of registrations exceeded. |
| 29360216 | Invalid continuation mode. |
**示例:** **示例:**
```ts ```ts
...@@ -100,6 +121,17 @@ register(options?: ContinuationExtraParams): Promise\<number>; ...@@ -100,6 +121,17 @@ register(options?: ContinuationExtraParams): Promise\<number>;
| ------------------------- | ------------------ | | ------------------------- | ------------------ |
| Promise\<number> | Promise形式返回流转管理服务连接后生成的token。 | | Promise\<number> | Promise形式返回流转管理服务连接后生成的token。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 3 | Failed to flatten the object |
| 7 | The object is null. |
| 29360207 | The maximum number of registrations exceeded. |
| 29360216 | Invalid continuation mode. |
**示例:** **示例:**
```ts ```ts
...@@ -131,6 +163,16 @@ registerContinuation(callback: AsyncCallback\<number>): void; ...@@ -131,6 +163,16 @@ registerContinuation(callback: AsyncCallback\<number>): void;
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback\<number> | 是 | AsyncCallback形式返回流转管理服务连接后生成的token。 | | callback | AsyncCallback\<number> | 是 | AsyncCallback形式返回流转管理服务连接后生成的token。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 401 | The parameter check failed. |
| 16600001 | The system ability work abnormally. |
| 16600003 | The number of token registration times has reached the upper limit. |
**示例:** **示例:**
```ts ```ts
...@@ -164,6 +206,16 @@ registerContinuation(options: ContinuationExtraParams, callback: AsyncCallback\< ...@@ -164,6 +206,16 @@ registerContinuation(options: ContinuationExtraParams, callback: AsyncCallback\<
| options | [ContinuationExtraParams](js-apis-continuation-continuationExtraParams.md) | 是 | 过滤可选择设备列表的额外参数。 | | options | [ContinuationExtraParams](js-apis-continuation-continuationExtraParams.md) | 是 | 过滤可选择设备列表的额外参数。 |
| callback | AsyncCallback\<number> | 是 | AsyncCallback形式返回流转管理服务连接后生成的token。 | | callback | AsyncCallback\<number> | 是 | AsyncCallback形式返回流转管理服务连接后生成的token。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 401 | The parameter check failed. |
| 16600001 | The system ability work abnormally. |
| 16600003 | The number of token registration times has reached the upper limit. |
**示例:** **示例:**
```ts ```ts
...@@ -205,6 +257,16 @@ registerContinuation(options?: ContinuationExtraParams): Promise\<number>; ...@@ -205,6 +257,16 @@ registerContinuation(options?: ContinuationExtraParams): Promise\<number>;
| ------------------------- | ------------------ | | ------------------------- | ------------------ |
| Promise\<number> | Promise形式返回流转管理服务连接后生成的token。 | | Promise\<number> | Promise形式返回流转管理服务连接后生成的token。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 401 | The parameter check failed. |
| 16600001 | The system ability work abnormally. |
| 16600003 | The number of token registration times has reached the upper limit. |
**示例:** **示例:**
```ts ```ts
...@@ -244,6 +306,18 @@ on(type: "deviceConnect", callback: Callback\<ContinuationResult>): void; ...@@ -244,6 +306,18 @@ on(type: "deviceConnect", callback: Callback\<ContinuationResult>): void;
| type | string | 是 | 监听的事件类型,固定值"deviceConnect"。 | | type | string | 是 | 监听的事件类型,固定值"deviceConnect"。 |
| callback | Callback\<[ContinuationResult](js-apis-continuation-continuationResult.md)> | 是 | 当用户从设备选择模块中选择设备时调用,返回设备ID、设备类型和设备名称供开发者使用。 | | callback | Callback\<[ContinuationResult](js-apis-continuation-continuationResult.md)> | 是 | 当用户从设备选择模块中选择设备时调用,返回设备ID、设备类型和设备名称供开发者使用。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 3 | Failed to flatten the object |
| 7 | The object is null | 7 |
| 29360208 | The token has not registered. |
| 29360209 | Callback has been registered. |
| 29360214 | The type of callback is not supported. |
**示例:** **示例:**
```ts ```ts
...@@ -271,6 +345,18 @@ on(type: "deviceDisconnect", callback: Callback\<string>): void; ...@@ -271,6 +345,18 @@ on(type: "deviceDisconnect", callback: Callback\<string>): void;
| type | string | 是 | 监听的事件类型,固定值"deviceDisconnect"。 | | type | string | 是 | 监听的事件类型,固定值"deviceDisconnect"。 |
| callback | Callback\<string> | 是 | 当用户从设备选择模块中断开设备时调用,返回设备ID供开发者使用。 | | callback | Callback\<string> | 是 | 当用户从设备选择模块中断开设备时调用,返回设备ID供开发者使用。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 3 | Failed to flatten the object. |
| 7 | The object is null. |
| 29360208 | The token has not registered. |
| 29360209 | Callback has been registered. |
| 29360214 | The type of callback is not supported. |
**示例:** **示例:**
```ts ```ts
...@@ -296,6 +382,18 @@ off(type: "deviceConnect", callback?: Callback\<ContinuationResult>): void; ...@@ -296,6 +382,18 @@ off(type: "deviceConnect", callback?: Callback\<ContinuationResult>): void;
| type | string | 是 | 取消监听的事件类型,固定值"deviceConnect"。 | | type | string | 是 | 取消监听的事件类型,固定值"deviceConnect"。 |
| callback | Callback\<[ContinuationResult](js-apis-continuation-continuationResult.md)> | 否 | 当用户从设备选择模块中选择设备时调用,返回设备ID、设备类型和设备名称供开发者使用。 | | callback | Callback\<[ContinuationResult](js-apis-continuation-continuationResult.md)> | 否 | 当用户从设备选择模块中选择设备时调用,返回设备ID、设备类型和设备名称供开发者使用。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 3 | Failed to flatten the object. |
| 7 | The object is null. |
| 29360208 | The token has not registered. |
| 29360210 | Callback has not registered. |
| 29360214 | The type of callback is not supported. |
**示例:** **示例:**
```ts ```ts
...@@ -323,6 +421,18 @@ off(type: "deviceDisconnect", callback?: Callback\<string>): void; ...@@ -323,6 +421,18 @@ off(type: "deviceDisconnect", callback?: Callback\<string>): void;
| type | string | 是 | 取消监听的事件类型,固定值"deviceDisconnect"。 | | type | string | 是 | 取消监听的事件类型,固定值"deviceDisconnect"。 |
| callback | Callback\<string> | 否 | 当用户从设备选择模块中断开设备时调用,返回设备ID供开发者使用。 | | callback | Callback\<string> | 否 | 当用户从设备选择模块中断开设备时调用,返回设备ID供开发者使用。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 3 | Failed to flatten the object. |
| 7 | The object is null. |
| 29360208 | The token has not registered. |
| 29360210 | Callback has not registered. |
| 29360214 | The type of callback is not supported. |
**示例:** **示例:**
```ts ```ts
...@@ -347,6 +457,17 @@ on(type: "deviceConnect", token: number, callback: Callback\<Array\<Continuation ...@@ -347,6 +457,17 @@ on(type: "deviceConnect", token: number, callback: Callback\<Array\<Continuation
| token | number | 是 | 注册后的token。 | | token | number | 是 | 注册后的token。 |
| callback | Callback\<Array\<[ContinuationResult](js-apis-continuation-continuationResult.md)>> | 是 | 当用户从设备选择模块中选择设备时调用,返回设备ID、设备类型和设备名称供开发者使用。 | | callback | Callback\<Array\<[ContinuationResult](js-apis-continuation-continuationResult.md)>> | 是 | 当用户从设备选择模块中选择设备时调用,返回设备ID、设备类型和设备名称供开发者使用。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 401 | The parameter check failed. |
| 16600001 | The system ability work abnormally. |
| 16600002 | The specified token or callback has not registered. |
| 16600004 | The specified callback has been registered. |
**示例:** **示例:**
```ts ```ts
...@@ -381,6 +502,17 @@ on(type: "deviceDisconnect", token: number, callback: Callback\<Array\<string>>) ...@@ -381,6 +502,17 @@ on(type: "deviceDisconnect", token: number, callback: Callback\<Array\<string>>)
| token | number | 是 | 注册后的token。 | | token | number | 是 | 注册后的token。 |
| callback | Callback\<Array\<string>> | 是 | 当用户从设备选择模块中断开设备时调用,返回设备ID供开发者使用。 | | callback | Callback\<Array\<string>> | 是 | 当用户从设备选择模块中断开设备时调用,返回设备ID供开发者使用。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 401 | The parameter check failed. |
| 16600001 | The system ability work abnormally. |
| 16600002 | The specified token or callback has not registered. |
| 16600004 | The specified callback has been registered. |
**示例:** **示例:**
```ts ```ts
...@@ -413,6 +545,17 @@ off(type: "deviceConnect", token: number): void; ...@@ -413,6 +545,17 @@ off(type: "deviceConnect", token: number): void;
| type | string | 是 | 取消监听的事件类型,固定值"deviceConnect"。 | | type | string | 是 | 取消监听的事件类型,固定值"deviceConnect"。 |
| token | number | 是 | 注册后的token。 | | token | number | 是 | 注册后的token。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 401 | The parameter check failed. |
| 16600001 | The system ability work abnormally. |
| 16600002 | The specified token or callback has not registered. |
| 16600004 | The specified callback has been registered. |
**示例:** **示例:**
```ts ```ts
...@@ -439,6 +582,17 @@ off(type: "deviceDisconnect", token: number): void; ...@@ -439,6 +582,17 @@ off(type: "deviceDisconnect", token: number): void;
| type | string | 是 | 取消监听的事件类型,固定值"deviceDisconnect"。 | | type | string | 是 | 取消监听的事件类型,固定值"deviceDisconnect"。 |
| token | number | 是 | 注册后的token。 | | token | number | 是 | 注册后的token。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 401 | The parameter check failed. |
| 16600001 | The system ability work abnormally. |
| 16600002 | The specified token or callback has not registered. |
| 16600004 | The specified callback has been registered. |
**示例:** **示例:**
```ts ```ts
...@@ -467,6 +621,19 @@ startDeviceManager(token: number, callback: AsyncCallback\<void>): void; ...@@ -467,6 +621,19 @@ startDeviceManager(token: number, callback: AsyncCallback\<void>): void;
| token | number | 是 | 注册后的token。 | | token | number | 是 | 注册后的token。 |
| callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 | | callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 3 | Failed to flatten the object. |
| 7 | The object is null. |
| 29360208 | The token has not registered. |
| 29360210 | Callback has not registered. |
| 29360211 | Failed to connect ability. |
| 29360216 | Invalid continuation mode. |
**示例:** **示例:**
```ts ```ts
...@@ -498,6 +665,19 @@ startDeviceManager(token: number, options: ContinuationExtraParams, callback: As ...@@ -498,6 +665,19 @@ startDeviceManager(token: number, options: ContinuationExtraParams, callback: As
| options | [ContinuationExtraParams](js-apis-continuation-continuationExtraParams.md) | 是 | 过滤可选择设备列表的额外参数。 | | options | [ContinuationExtraParams](js-apis-continuation-continuationExtraParams.md) | 是 | 过滤可选择设备列表的额外参数。 |
| callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 | | callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 3 | Failed to flatten the object |
| 7 | The object is null |
| 29360208 | The token has not registered. |
| 29360210 | Callback has not registered. |
| 29360211 | Failed to connect ability. |
| 29360216 | Invalid continuation mode. |
**示例:** **示例:**
```ts ```ts
...@@ -537,6 +717,19 @@ startDeviceManager(token: number, options?: ContinuationExtraParams): Promise\<v ...@@ -537,6 +717,19 @@ startDeviceManager(token: number, options?: ContinuationExtraParams): Promise\<v
| ------------------------- | ------------------ | | ------------------------- | ------------------ |
| Promise\<void> | Promise形式返回接口调用结果。 | | Promise\<void> | Promise形式返回接口调用结果。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 3 | Failed to flatten the object |
| 7 | The object is null |
| 29360208 | The token has not registered. |
| 29360210 | Callback has not registered. |
| 29360211 | Failed to connect ability. |
| 29360216 | Invalid continuation mode. |
**示例:** **示例:**
```ts ```ts
...@@ -568,6 +761,16 @@ startContinuationDeviceManager(token: number, callback: AsyncCallback\<void>): v ...@@ -568,6 +761,16 @@ startContinuationDeviceManager(token: number, callback: AsyncCallback\<void>): v
| token | number | 是 | 注册后的token。 | | token | number | 是 | 注册后的token。 |
| callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 | | callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 401 | The parameter check failed. |
| 16600001 | The system ability work abnormally. |
| 16600002 | The specified token or callback has not registered. |
**示例:** **示例:**
```ts ```ts
...@@ -601,6 +804,16 @@ startContinuationDeviceManager(token: number, options: ContinuationExtraParams, ...@@ -601,6 +804,16 @@ startContinuationDeviceManager(token: number, options: ContinuationExtraParams,
| options | [ContinuationExtraParams](js-apis-continuation-continuationExtraParams.md) | 是 | 过滤可选择设备列表的额外参数。 | | options | [ContinuationExtraParams](js-apis-continuation-continuationExtraParams.md) | 是 | 过滤可选择设备列表的额外参数。 |
| callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 | | callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 401 | The parameter check failed. |
| 16600001 | The system ability work abnormally. |
| 16600002 | The specified token or callback has not registered. |
**示例:** **示例:**
```ts ```ts
...@@ -642,6 +855,16 @@ startContinuationDeviceManager(token: number, options?: ContinuationExtraParams) ...@@ -642,6 +855,16 @@ startContinuationDeviceManager(token: number, options?: ContinuationExtraParams)
| ------------------------- | ------------------ | | ------------------------- | ------------------ |
| Promise\<void> | Promise形式返回接口调用结果。 | | Promise\<void> | Promise形式返回接口调用结果。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 401 | The parameter check failed. |
| 16600001 | The system ability work abnormally. |
| 16600002 | The specified token or callback has not registered. |
**示例:** **示例:**
```ts ```ts
...@@ -681,6 +904,19 @@ updateConnectStatus(token: number, deviceId: string, status: DeviceConnectState, ...@@ -681,6 +904,19 @@ updateConnectStatus(token: number, deviceId: string, status: DeviceConnectState,
| status | [DeviceConnectState](#deviceconnectstate) | 是 | 设备连接状态。 | | status | [DeviceConnectState](#deviceconnectstate) | 是 | 设备连接状态。 |
| callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 | | callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 3 | Failed to flatten the object. |
| 7 | The object is null. |
| 29360208 | The token has not registered. |
| 29360210 | Callback has not registered. |
| 29360211 | Failed to connect ability. |
| 29360215 | Invalid connect state. |
**示例:** **示例:**
```ts ```ts
...@@ -719,6 +955,19 @@ updateConnectStatus(token: number, deviceId: string, status: DeviceConnectState) ...@@ -719,6 +955,19 @@ updateConnectStatus(token: number, deviceId: string, status: DeviceConnectState)
| ------------------------- | ------------------ | | ------------------------- | ------------------ |
| Promise\<void> | Promise形式返回接口调用结果。 | | Promise\<void> | Promise形式返回接口调用结果。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 3 | Failed to flatten the object. |
| 7 | The object is null. |
| 29360208 | The token has not registered. |
| 29360210 | Callback has not registered. |
| 29360211 | Failed to connect ability. |
| 29360215 | Invalid connect state. |
**示例:** **示例:**
```ts ```ts
...@@ -750,6 +999,16 @@ updateContinuationState(token: number, deviceId: string, status: DeviceConnectSt ...@@ -750,6 +999,16 @@ updateContinuationState(token: number, deviceId: string, status: DeviceConnectSt
| status | [DeviceConnectState](#deviceconnectstate) | 是 | 设备连接状态。 | | status | [DeviceConnectState](#deviceconnectstate) | 是 | 设备连接状态。 |
| callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 | | callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 401 | The parameter check failed. |
| 16600001 | The system ability work abnormally. |
| 16600002 | The specified token or callback has not registered. |
**示例:** **示例:**
```ts ```ts
...@@ -790,6 +1049,16 @@ updateContinuationState(token: number, deviceId: string, status: DeviceConnectSt ...@@ -790,6 +1049,16 @@ updateContinuationState(token: number, deviceId: string, status: DeviceConnectSt
| ------------------------- | ------------------ | | ------------------------- | ------------------ |
| Promise\<void> | Promise形式返回接口调用结果。 | | Promise\<void> | Promise形式返回接口调用结果。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 401 | The parameter check failed. |
| 16600001 | The system ability work abnormally. |
| 16600002 | The specified token or callback has not registered. |
**示例:** **示例:**
```ts ```ts
...@@ -826,6 +1095,16 @@ unregister(token: number, callback: AsyncCallback\<void>): void; ...@@ -826,6 +1095,16 @@ unregister(token: number, callback: AsyncCallback\<void>): void;
| token | number | 是 | 注册后的token。 | | token | number | 是 | 注册后的token。 |
| callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 | | callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 3 | Failed to flatten the object. |
| 7 | The object is null. |
| 29360208 | The token has not registered. |
**示例:** **示例:**
```ts ```ts
...@@ -861,6 +1140,16 @@ unregister(token: number): Promise\<void>; ...@@ -861,6 +1140,16 @@ unregister(token: number): Promise\<void>;
| ------------------------- | ------------------ | | ------------------------- | ------------------ |
| Promise\<void> | Promise形式返回接口调用结果。 | | Promise\<void> | Promise形式返回接口调用结果。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 3 | Failed to flatten the object. |
| 7 | The object is null. |
| 29360208 | The token has not registered. |
**示例:** **示例:**
```ts ```ts
...@@ -889,6 +1178,16 @@ unregisterContinuation(token: number, callback: AsyncCallback\<void>): void; ...@@ -889,6 +1178,16 @@ unregisterContinuation(token: number, callback: AsyncCallback\<void>): void;
| token | number | 是 | 注册后的token。 | | token | number | 是 | 注册后的token。 |
| callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 | | callback | AsyncCallback\<void> | 是 | AsyncCallback形式返回接口调用结果。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 401 | The parameter check failed. |
| 16600001 | The system ability work abnormally. |
| 16600002 | The specified token or callback has not registered. |
**示例:** **示例:**
```ts ```ts
...@@ -926,6 +1225,16 @@ unregisterContinuation(token: number): Promise\<void>; ...@@ -926,6 +1225,16 @@ unregisterContinuation(token: number): Promise\<void>;
| ------------------------- | ------------------ | | ------------------------- | ------------------ |
| Promise\<void> | Promise形式返回接口调用结果。 | | Promise\<void> | Promise形式返回接口调用结果。 |
**错误码:**
以下错误码的详细介绍请参见[分布式调度错误码](../errorcodes/errcode-DistributedSchedule.md)
| 错误码ID | 错误信息 |
| ------- | -------------------------------------------- |
| 401 | The parameter check failed. |
| 16600001 | The system ability work abnormally. |
| 16600002 | The specified token or callback has not registered. |
**示例:** **示例:**
```ts ```ts
......
...@@ -376,9 +376,9 @@ continueMission(parameter: ContinueDeviceInfo, options: ContinueCallback, callba ...@@ -376,9 +376,9 @@ continueMission(parameter: ContinueDeviceInfo, options: ContinueCallback, callba
```ts ```ts
var parameter = { var parameter = {
srcDeviceId: localDeviceId srcDeviceId: localDeviceId,
dstDeviceId: remoteDeviceId dstDeviceId: remoteDeviceId,
missionId: remoteMissionId missionId: remoteMissionId,
wantParams: {"key": "value"} wantParams: {"key": "value"}
}; };
function OnContinueDone(resultCode) { function OnContinueDone(resultCode) {
...@@ -426,9 +426,9 @@ continueMission(parameter: ContinueDeviceInfo, options: ContinueCallback): Promi ...@@ -426,9 +426,9 @@ continueMission(parameter: ContinueDeviceInfo, options: ContinueCallback): Promi
```ts ```ts
var parameter = { var parameter = {
srcDeviceId: localDeviceId srcDeviceId: localDeviceId,
dstDeviceId: remoteDeviceId dstDeviceId: remoteDeviceId,
missionId: remoteMissionId missionId: remoteMissionId,
wantParams: {"key": "value"} wantParams: {"key": "value"}
}; };
function OnContinueDone(resultCode) { function OnContinueDone(resultCode) {
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
### 错误信息 ### 错误信息
Permission denied. Permission denied.
### 错误描述
当调用流转管理和迁移等接口时,若缺少ohos.permission.MANAGER_MISSIONS或ohos.permission.DISTRIBUTED_DATASYNC,会报此错误码。
### 可能原因 ### 可能原因
该错误码表示权限校验失败,可能原因是未配置对应权限。 该错误码表示权限校验失败,可能原因是未配置对应权限。
...@@ -16,6 +20,10 @@ Permission denied. ...@@ -16,6 +20,10 @@ Permission denied.
### 错误信息 ### 错误信息
The parameter check failed. The parameter check failed.
### 错误描述
当调用接口提供的入参出现类型、个数、数组大小以及合法性等错误时,会报此错误码。
### 可能原因 ### 可能原因
该错误码表示入参检查错误,可能原因是callback入参检查错误。 该错误码表示入参检查错误,可能原因是callback入参检查错误。
...@@ -27,6 +35,10 @@ The parameter check failed. ...@@ -27,6 +35,10 @@ The parameter check failed.
### 错误信息 ### 错误信息
The system ability work abnormally. The system ability work abnormally.
### 错误描述
当系统服务工作异常时,会报此错误码。
### 可能原因 ### 可能原因
该错误码表示系统服务工作异常,可能原因如下。 该错误码表示系统服务工作异常,可能原因如下。
1. DMS服务没有正常启动。 1. DMS服务没有正常启动。
...@@ -38,6 +50,10 @@ The system ability work abnormally. ...@@ -38,6 +50,10 @@ The system ability work abnormally.
## 16600002 指定的token或callback未注册 ## 16600002 指定的token或callback未注册
### 错误描述
当调用continuationManager相关的接口时传入的token或callback未提前注册,会报此错误码。
### 错误信息 ### 错误信息
The specified token or callback has not registered. The specified token or callback has not registered.
...@@ -49,6 +65,10 @@ The specified token or callback has not registered. ...@@ -49,6 +65,10 @@ The specified token or callback has not registered.
## 16600003 应用注册token已达到最大次数限制 ## 16600003 应用注册token已达到最大次数限制
### 错误描述
当调用continuationManager.registerContinuation接口时次数过多超出限制,会报此错误码。
### 错误信息 ### 错误信息
The number of token registration times has reached the upper limit. The number of token registration times has reached the upper limit.
...@@ -60,6 +80,10 @@ The number of token registration times has reached the upper limit. ...@@ -60,6 +80,10 @@ The number of token registration times has reached the upper limit.
## 16600004 指定的callback已注册 ## 16600004 指定的callback已注册
### 错误描述
当使用相同的callback调用continuationManager的on接口时,会报此错误码。
### 错误信息 ### 错误信息
The specified callback has been registered. The specified callback has been registered.
...@@ -71,6 +95,10 @@ The specified callback has been registered. ...@@ -71,6 +95,10 @@ The specified callback has been registered.
## 16300501 系统服务工作异常 ## 16300501 系统服务工作异常
### 错误描述
当系统服务工作异常时,会报此错误码。
### 错误信息 ### 错误信息
The system ability work abnormally. The system ability work abnormally.
...@@ -85,6 +113,10 @@ The system ability work abnormally. ...@@ -85,6 +113,10 @@ The system ability work abnormally.
## 16300502 获取指定的missionId的missionInfo失败 ## 16300502 获取指定的missionId的missionInfo失败
### 错误描述
当调用distributedMissionManager.continueMission接口获取指定missionId的missionInfo失败时,会报此错误码。
### 错误信息 ### 错误信息
Failed to get the missionInfo of the specified missionId. Failed to get the missionInfo of the specified missionId.
...@@ -98,6 +130,10 @@ Failed to get the missionInfo of the specified missionId. ...@@ -98,6 +130,10 @@ Failed to get the missionInfo of the specified missionId.
## 16300503 远端未安装应用且不支持免安装 ## 16300503 远端未安装应用且不支持免安装
### 错误描述
当调用distributedMissionManager.continueMission接口使用迁移功能时,若远端未安装应用且不支持免安装,会报此错误码。
### 错误信息 ### 错误信息
The application is not installed on the remote end and installation-free is not supported. The application is not installed on the remote end and installation-free is not supported.
...@@ -110,6 +146,10 @@ The application is not installed on the remote end and installation-free is not ...@@ -110,6 +146,10 @@ The application is not installed on the remote end and installation-free is not
## 16300504 远端未安装应用但支持免安装,需使用免安装标识重试 ## 16300504 远端未安装应用但支持免安装,需使用免安装标识重试
### 错误描述
当调用distributedMissionManager.continueMission接口使用迁移功能时,若远端未安装应用但支持免安装,会报此错误码。
### 错误信息 ### 错误信息
The application is not installed on the remote end but installation-free is supported, try again with freeInstall flag. The application is not installed on the remote end but installation-free is supported, try again with freeInstall flag.
...@@ -121,6 +161,10 @@ The application is not installed on the remote end but installation-free is supp ...@@ -121,6 +161,10 @@ The application is not installed on the remote end but installation-free is supp
## 16300505 操作设备必须是迁移的应用所在的设备或需迁移到的目标设备 ## 16300505 操作设备必须是迁移的应用所在的设备或需迁移到的目标设备
### 错误描述
当调用distributedMissionManager.continueMission接口使用迁移功能时,若操作设备不是迁移的应用所在的设备或需迁移到的目标设备,会报此错误码。
### 错误信息 ### 错误信息
The operation device must be the device where the application to be continued is located or the target device to be continued. The operation device must be the device where the application to be continued is located or the target device to be continued.
...@@ -132,6 +176,10 @@ The operation device must be the device where the application to be continued is ...@@ -132,6 +176,10 @@ The operation device must be the device where the application to be continued is
## 16300506 本地迁移任务已在进行中 ## 16300506 本地迁移任务已在进行中
### 错误描述
当调用distributedMissionManager.continueMission接口使用迁移功能时,若本地迁移任务已在进行中,会报此错误码。
### 错误信息 ### 错误信息
The local continuation task is already in progress. The local continuation task is already in progress.
...@@ -143,6 +191,10 @@ The local continuation task is already in progress. ...@@ -143,6 +191,10 @@ The local continuation task is already in progress.
## 3 序列化对象失败 ## 3 序列化对象失败
### 错误描述
当调用continuationManager相关接口时,若系统参数DMS_PROXY_INTERFACE_TOKEN序列化写失败,会报此错误码。
### 错误信息 ### 错误信息
Failed to flatten the object. Failed to flatten the object.
...@@ -157,6 +209,10 @@ Failed to flatten the object. ...@@ -157,6 +209,10 @@ Failed to flatten the object.
### 错误信息 ### 错误信息
The object is null. The object is null.
### 错误描述
当调用流转和迁移相关接口时,若出现dms以及其他对象为空或序列化读失败,会报此错误码。
### 可能原因 ### 可能原因
该错误码表示接口依赖的服务对象或参数对象为空,可能原因如下。 该错误码表示接口依赖的服务对象或参数对象为空,可能原因如下。
1. 入参序列化读失败。 1. 入参序列化读失败。
...@@ -170,6 +226,10 @@ The object is null. ...@@ -170,6 +226,10 @@ The object is null.
## 29360207 注册超出最大次数 ## 29360207 注册超出最大次数
### 错误描述
当调用continuationManager.register接口时次数过多超出限制,会报此错误码。
### 错误信息 ### 错误信息
The maximum number of registrations exceeded. The maximum number of registrations exceeded.
...@@ -181,6 +241,10 @@ The maximum number of registrations exceeded. ...@@ -181,6 +241,10 @@ The maximum number of registrations exceeded.
## 29360208 token未注册 ## 29360208 token未注册
### 错误描述
当调用continuationManager相关接口时使用未注册的token,会报此错误码。
### 错误信息 ### 错误信息
The token has not registered. The token has not registered.
...@@ -192,6 +256,10 @@ The token has not registered. ...@@ -192,6 +256,10 @@ The token has not registered.
## 29360209 callback已注册 ## 29360209 callback已注册
### 错误描述
当使用相同的callback重复调用continuationManager.on接口时,会报此错误码。
### 错误信息 ### 错误信息
Callback has been registered. Callback has been registered.
...@@ -203,6 +271,10 @@ Callback has been registered. ...@@ -203,6 +271,10 @@ Callback has been registered.
## 29360210 callback未注册 ## 29360210 callback未注册
### 错误描述
当调用continuationManager的off、updateConnectStatus和startDeviceManager等接口时,若未提前调用on接口注册callback,会报此错误码。
### 错误信息 ### 错误信息
Callback has not been registered. Callback has not been registered.
...@@ -214,6 +286,10 @@ Callback has not been registered. ...@@ -214,6 +286,10 @@ Callback has not been registered.
## 29360211 连接ability失败 ## 29360211 连接ability失败
### 错误描述
当调用continuationManager的startDeviceManager接口时,若连接相应Ability失败时,会报此错误码。
### 错误信息 ### 错误信息
Failed to connect ability. Failed to connect ability.
...@@ -225,6 +301,10 @@ Failed to connect ability. ...@@ -225,6 +301,10 @@ Failed to connect ability.
## 29360214 callback类型错误 ## 29360214 callback类型错误
### 错误描述
当调用continuationManager的on和off接口时,若参数callback类型错误时,会报此错误码。
### 错误信息 ### 错误信息
The type of callback is not supported. The type of callback is not supported.
...@@ -236,8 +316,12 @@ The type of callback is not supported. ...@@ -236,8 +316,12 @@ The type of callback is not supported.
## 29360215 无效的连接状态 ## 29360215 无效的连接状态
### 错误描述
当调用continuationManager的updateConnectStatus接口时,若参数status为无效值时,会报此错误码。
### 错误信息 ### 错误信息
Invalid continuation mode. Invalid connect state.
### 可能原因 ### 可能原因
该错误码表示无效的连接状态,可能原因是入参DeviceConnectState为非指定值。 该错误码表示无效的连接状态,可能原因是入参DeviceConnectState为非指定值。
...@@ -247,6 +331,10 @@ Invalid continuation mode. ...@@ -247,6 +331,10 @@ Invalid continuation mode.
## 29360216 无效的流转模式 ## 29360216 无效的流转模式
### 错误描述
当调用continuationManager的register和startDeviceManager接口时,若参数ContinuationExtraParams.continuationMode为无效值时,会报此错误码。
### 错误信息 ### 错误信息
Invalid continuation mode. Invalid continuation mode.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册