提交 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));
} }
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册