未验证 提交 43057b8d 编写于 作者: O openharmony_ci 提交者: Gitee

!19717 【资料问题】修复元能力接口一致性问题

Merge pull request !19717 from yuyaozhi/master
......@@ -12,7 +12,7 @@ import dataAbility from '@ohos.data.dataAbility'
import relationalStore from '@ohos.data.relationalStore'
const TABLE_NAME = 'book'
const STORE_CONFIG = { name: 'book.db' }
const STORE_CONFIG = { name: 'book.db',securityLevel: 1 }
const SQL_CREATE_TABLE = 'CREATE TABLE IF NOT EXISTS book(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, introduction TEXT NOT NULL)'
let rdbStore: relationalStore.RdbStore = undefined
......
......@@ -707,7 +707,7 @@ let connectId = featureAbility.connectAbility(
);
featureAbility.disconnectAbility(connectId).then((data) => {
console.log('data: ${data)}';
console.log('data: ${data)}')
}).catch((error)=>{
console.error('featureAbilityTest result errCode : ${error.code}');
});
......
......@@ -298,7 +298,7 @@ appManager.getRunningProcessInformation((err, data) => {
});
```
## appManager.isSharedBundleRunning
## appManager.isSharedBundleRunning<sup>10+</sup>
isSharedBundleRunning(bundleName: string, versionCode: number): Promise\<boolean>;
......@@ -323,11 +323,20 @@ isSharedBundleRunning(bundleName: string, versionCode: number): Promise\<boolean
| -------- | -------- |
| Promise\<boolean> | Promise对象。返回true表示共享库正在使用,返回false表示共享库不在使用。 |
**错误码**
| 错误码ID | 错误信息 |
| 16000050 | Internal error. |
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:**
```ts
import appManager from '@ohos.app.ability.appManager';
const bundleName = "this is a bundleName";
const versionCode = 1;
appManager.isSharedBundleRunning(bundleName, versionCode).then((data) => {
console.log('The shared bundle running is: ${JSON.stringify(data)}');
}).catch((error) => {
......@@ -335,7 +344,7 @@ appManager.isSharedBundleRunning(bundleName, versionCode).then((data) => {
});
```
## appManager.isSharedBundleRunning
## appManager.isSharedBundleRunning<sup>10+</sup>
isSharedBundleRunning(bundleName: string, versionCode: number, callback: AsyncCallback\<boolean>): void;
......@@ -353,18 +362,22 @@ isSharedBundleRunning(bundleName: string, versionCode: number, callback: AsyncCa
| --------- | ---------------------------------------- | ---- | -------------- |
| bundleName | string | 是 | 表示要查询的共享库包名。 |
| versionCode | number | 是 | 表示要查询的共享库版本号。 |
|AsyncCallback\<boolean>> | 回调函数。返回true表示共享库正在使用,返回false表示共享库不在使用。 |
**参数:**
**错误码**
| 类型 | 说明 |
| -------- | -------- |
|AsyncCallback\<boolean>> | 回调函数。返回true表示共享库正在使用,返回false表示共享库不在使用。 |
| 错误码ID | 错误信息 |
| 16000050 | Internal error. |
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
**示例:**
```ts
import appManager from '@ohos.app.ability.appManager';
const bundleName = "this is a bundleName";
const versionCode = 1;
appManager.isSharedBundleRunning(bundleName, versionCode, (err, data) => {
if (err) {
console.error('err: ${JSON.stringify(err)}');
......@@ -749,7 +762,7 @@ killProcessWithAccount(bundleName: string, accountId: number): Promise\<void\>
>
> 当accountId为当前用户时,不需要校验ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS权限。
**需要权限**:ohos.permission.CLEAN_BACKGROUND_PROCESSESohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**需要权限**:ohos.permission.CLEAN_BACKGROUND_PROCESSES, ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -799,7 +812,7 @@ killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCal
>
> 当accountId为当前用户时,不需要校验ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS权限。
**需要权限**:ohos.permission.CLEAN_BACKGROUND_PROCESSESohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**需要权限**:ohos.permission.CLEAN_BACKGROUND_PROCESSES, ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......
......@@ -173,6 +173,8 @@ saveAppState(context?: UIAbilityContext): boolean;
```ts
import appRecovery from '@ohos.app.ability.appRecovery';
import errorManager from '@ohos.app.ability.errorManager';
let observer = {
onUnhandledException(errorMsg) {
console.log('onUnhandledException, errorMsg: ', errorMsg);
......
......@@ -298,7 +298,7 @@ getRequestCallback(want: Want): RequestCallback
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
| 参数名 | 值 | 说明 |
| 名称 | 值 | 说明 |
| ------------ | ------------------ | ---------------------- |
| RESULT_OK | 0 | 表示成功。 |
| RESULT_CANCEL | 1 | 表示失败。 |
......@@ -324,7 +324,7 @@ setRequestResult(result: RequestResult): void;
设置请求结果
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore
**参数:**
......
......@@ -7,4 +7,10 @@ ExtensionAbility是特定场景扩展能力的基类,继承自[Ability](js-api
> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。
## 导入模块
```ts
import ExtensionAbility from '@ohos.app.ability.ExtensionAbility';
```
**系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore
\ No newline at end of file
......@@ -946,7 +946,7 @@ clearAllMissions(): Promise&lt;void&gt;;
import missionManager from '@ohos.app.ability.missionManager';
try {
missionManager.clearAllMissions(bundleName).then((data) => {
missionManager.clearAllMissions().then((data) => {
console.info('clearAllMissions successfully. Data: ${JSON.stringify(data)}');
}).catch(err => {
console.error('clearAllMissions failed: ${err.message}');
......
......@@ -257,7 +257,7 @@ revokeQuickFix(bundleName: string, callback: AsyncCallback\<void>): void;
撤销快速修复的接口,使用callback方式返回结果。
**需要权限**:ohos.permission.INSTALL_BUNDLE ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
**需要权限**:ohos.permission.INSTALL_BUNDLE, ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.QuickFix
......@@ -302,7 +302,7 @@ revokeQuickFix(bundleName: string): Promise\<void>;
撤销快速修复的接口,使用Promise方式返回结果。
**需要权限**:ohos.permission.INSTALL_BUNDLE ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
**需要权限**:ohos.permission.INSTALL_BUNDLE, ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.QuickFix
......
......@@ -19,7 +19,7 @@ import StartOptions from '@ohos.app.ability.StartOptions';
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| [windowMode](js-apis-app-ability-abilityConstant.md#abilityconstantwindowmode) | number | 否 | 窗口模式。 |
| [windowMode](js-apis-app-ability-abilityConstant.md#abilityconstantwindowmode) | number | 否 | 窗口模式。<br>**系统API**:该接口为系统接口,三方应用不支持调用。 |
| displayId | number | 否 | 屏幕ID。默认是0,表示当前屏幕。 |
**示例:**
......
......@@ -668,11 +668,12 @@ onRemoteStateChange(callback: OnRemoteStateChangeCallback): void;
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
import window from '@ohos.window';
let caller;
let dstDeviceId: string;
export default class MainAbility extends UIAbility {
onWindowStageCreate(windowStage: Window.WindowStage) {
onWindowStageCreate(windowStage: window.WindowStage) {
this.context.startAbilityByCall({
bundleName: 'com.example.myservice',
abilityName: 'MainUIAbility',
......@@ -688,7 +689,7 @@ onRemoteStateChange(callback: OnRemoteStateChangeCallback): void;
}
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ${JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)}');
})
})
}
}
```
......
......@@ -176,13 +176,14 @@ import Want from '@ohos.app.ability.Want';
bundleName: 'com.example.myapplication1',
abilityName: 'ServiceExtensionAbility',
};
context.startAbility(want, (err) => {
console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
});
```
```ts
// (2) 该ServiceExtension去启动另一个UIAbility2,并在启动的时候携带参数ability.params.backToOtherMissionStack为true
let context = ...; // ServiceExtensionContext
let context ; // ServiceExtensionContext
let want = {
bundleName: 'com.example.myapplication2',
abilityName: 'MainAbility',
......
......@@ -25,7 +25,7 @@ want的Params操作的常量。
| DLP_PARAMS_MODULE_NAME | ohos.dlp.params.moduleName | 指示DLP模块名称的参数的操作。 <br>**系统API**:该接口为系统接口,三方应用不支持调用。 |
| DLP_PARAMS_ABILITY_NAME | ohos.dlp.params.abilityName | 指示DLP能力名称的参数的操作。 <br>**系统API**:该接口为系统接口,三方应用不支持调用。 |
| DLP_PARAMS_INDEX | ohos.dlp.params.index | 指示DLP索引参数的操作。 <br>**系统API**:该接口为系统接口,三方应用不支持调用。 |
| ABILITY_BACK_TO_OTHER_MISSION_STACK | ability.params.backToOtherMissionStack | 表示是否支持跨任务链返回。 <br>**系统API**:该接口为系统接口,三方应用不支持调用。 |
| ABILITY_BACK_TO_OTHER_MISSION_STACK | ability.params.backToOtherMissionStack | 表示是否支持跨任务链返回。 |
| ABILITY_RECOVERY_RESTART<sup>10+</sup> | ohos.ability.params.abilityRecoveryRestart | 指示当前Ability是否发生了故障恢复重启。 |
| CONTENT_TITLE_KEY<sup>10+</sup> | ohos.extra.param.key.contentTitle | 指示原子化服务支持分享标题的参数的操作。 |
| SHARE_ABSTRACT_KEY<sup>10+</sup> | ohos.extra.param.key.shareAbstract | 指示原子化服务支持分享内容的参数的操作。 |
......
......@@ -36,7 +36,6 @@ FormBindingData相关描述。
| data | Object | 是 | js卡片要展示的数据。可以是包含若干键值对的Object或者 json 格式的字符串。|
| proxies<sup>10+</sup> | Array<[ProxyData](#proxydata)> | 否 | 卡片代理刷新的订阅信息,默认为空数组。|
## createFormBindingData
createFormBindingData(obj?: Object | string): FormBindingData
......@@ -75,4 +74,15 @@ try {
} catch (error) {
console.error(`catch error, code: ${error.code}, message: ${error.message}`);
}
```
\ No newline at end of file
```
## ProxyData
定义表单代理数据。
**系统能力**:SystemCapability.Ability.Form
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| key | string | 是 | 代理的密钥。值取决于数据发布者。|
| subscriberId | string | 否 | 订阅者ID。值取决于数据发布者。默认值为当前卡片ID。|
\ No newline at end of file
......@@ -2144,6 +2144,8 @@ acquireFormData(formId: string, callback: AsyncCallback<{[key: string]: Object}>
| 错误码ID | 错误信息 |
| -------- | -------- |
| 201 | Permissions denied. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16500100 | Failed to obtain the configuration information. |
......@@ -2196,6 +2198,8 @@ acquireFormData(formId: string): Promise<{[key: string]: Object}>;
| 错误码ID | 错误信息 |
| -------- | -------- |
| 201 | Permissions denied. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500060 | A service connection error happened, please try again later. |
| 16500100 | Failed to obtain the configuration information. |
......@@ -2246,9 +2250,14 @@ getRunningFormInfosByFilter(formProviderFilter: formInfo.FormProviderFilter): Pr
| 错误码ID | 错误信息 |
| -------- | -------- |
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
```ts
import formHost from '@ohos.app.form.formHost';
......@@ -2271,7 +2280,7 @@ try {
## getRunningFormInfosByFilter<sup>10+</sup>
getRunningFormInfosByFilter(formProviderFilter: formInfo.FormProviderFilter, callback: AsyncCallback&lt;Array&lt;formInfo.FormInfo&gt;&gt;): void
getRunningFormInfosByFilter(formProviderFilter: formInfo.FormProviderFilter, callback: AsyncCallback&lt;Array&lt;formInfo.RunningFormInfo&gt;&gt;): void
根据提供方信息查询卡片已有的使用方列表信息。使用callback异步回调。
......@@ -2283,7 +2292,7 @@ getRunningFormInfosByFilter(formProviderFilter: formInfo.FormProviderFilter, cal
| 参数名 | 类型 | 必填 | 说明 |
| ----------- | --------------- | ---- | -------------------------------- |
| formProviderFilter | formInfo.FormProviderFilter [formInfo.FormProviderFilter](js-apis-app-form-formInfo.md#formProviderFilter) | 是 | 卡片提供方应用信息。 |
| formProviderFilter | [formInfo.FormProviderFilter](js-apis-app-form-formInfo.md#formProviderFilter) | 是 | 卡片提供方应用信息。 |
| callback | AsyncCallback&lt;Array&lt;[formInfo.RunningFormInfo](js-apis-app-form-formInfo.md)&gt;&gt; | 是 | 回调函数。返回查询到的使用方列表信息,error为undefined,data为查询到的使用方列表信息;否则为错误对象。 |
**错误码:**
......@@ -2292,9 +2301,14 @@ getRunningFormInfosByFilter(formProviderFilter: formInfo.FormProviderFilter, cal
| 错误码ID | 错误信息 |
| -------- | -------- |
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
```ts
import formHost from '@ohos.app.form.formHost';
......@@ -2319,7 +2333,8 @@ try {
## getRunningFormInfoById<sup>10+</sup>
getRunningFormInfoById(formId: string): Promise&lt;Array&lt;formInfo.RunningFormInfo&gt;&gt;
function getRunningFormInfoById(formId: string): Promise&lt;formInfo.RunningFormInfo&gt;
根据formId查询卡片已有的使用方列表信息。使用Promise异步回调。
......@@ -2337,7 +2352,7 @@ getRunningFormInfoById(formId: string): Promise&lt;Array&lt;formInfo.RunningForm
| 类型 | 说明 |
| ------------------- | ------------------------- |
| Promise&lt;Array&lt;formInfo.RunningFormInfo[formInfo.RunningFormInfo](js-apis-app-form-formInfo.md)&gt;&gt; | Promise对象,返回查询到的使用方列表信息。 |
| Promise&lt;[formInfo.RunningFormInfo](js-apis-app-form-formInfo.md)&gt; | Promise对象,返回查询到的使用方列表信息。 |
**错误码:**
......@@ -2345,9 +2360,14 @@ getRunningFormInfoById(formId: string): Promise&lt;Array&lt;formInfo.RunningForm
| 错误码ID | 错误信息 |
| -------- | -------- |
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
```ts
import formHost from '@ohos.app.form.formHost';
let formId = '12400633174999288';
......@@ -2364,7 +2384,7 @@ try {
## getRunningFormInfoById<sup>10+</sup>
getRunningFormInfoById(formId: string, callback: AsyncCallback&lt;Array&lt;formInfo.FormInfo&gt;&gt;): void
getRunningFormInfoById(formId: string, callback: AsyncCallback&lt;formInfo.RunningFormInfo&gt;): void
根据提供方信息查询卡片已有的使用方列表信息。使用callback异步回调。
......@@ -2377,7 +2397,7 @@ getRunningFormInfoById(formId: string, callback: AsyncCallback&lt;Array&lt;formI
| 参数名 | 类型 | 必填 | 说明 |
| ----------- | --------------- | ---- | -------------------------------- |
| formId | string | 是 | 卡片标识。 |
| callback | AsyncCallback&lt;Array&lt;[formInfo.RunningFormInfo](js-apis-app-form-formInfo.md)&gt;&gt; | 是 | 回调函数。返回查询到的使用方列表信息,error为undefined,data为查询到的使用方列表信息;否则为错误对象。 |
| callback | AsyncCallback&lt;[formInfo.RunningFormInfo](js-apis-app-form-formInfo.md)&gt; | 是 | 回调函数。返回查询到的使用方列表信息,error为undefined,data为查询到的使用方列表信息;否则为错误对象。 |
**错误码:**
......@@ -2385,7 +2405,11 @@ getRunningFormInfoById(formId: string, callback: AsyncCallback&lt;Array&lt;formI
| 错误码ID | 错误信息 |
| -------- | -------- |
| 201 | Permissions denied. |
| 202 | The application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16500100 | Failed to obtain the configuration information. |
| 16501000 | An internal functional error occurred. |
```ts
......
......@@ -18,8 +18,6 @@ import formInfo from '@ohos.app.form.formInfo';
**系统能力**:SystemCapability.Ability.Form
**系统API**: 此接口为系统接口,三方应用不支持调用。
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ |
| bundleName | string | 是 | 否 | 卡片所属包的Bundle名称。 |
......@@ -27,6 +25,7 @@ import formInfo from '@ohos.app.form.formInfo';
| abilityName | string | 是 | 否 | 卡片所属的Ability名称。 |
| name | string | 是 | 否 | 卡片名称。 |
| description | string | 是 | 否 | 卡片描述。 |
| descriptionId | number | 是 | 否 | 卡片描述id。 |
| type | [FormType](#formtype) | 是 | 否 | 卡片类型。当前支持JS卡片。 |
| jsComponentName | string | 是 | 否 | js卡片的组件名。 |
| colorMode | [ColorMode](#colormode) | 是 | 否 | 卡片颜色模式。 |
......@@ -102,7 +101,7 @@ import formInfo from '@ohos.app.form.formInfo';
| HEIGHT_KEY | 'ohos.extra.param.key.form_height' | 卡片高度。 |
| TEMPORARY_KEY | 'ohos.extra.param.key.form_temporary' | 临时卡片。 |
| ABILITY_NAME_KEY | 'ohos.extra.param.key.ability_name' | ability名称。 |
| DEVICE_ID_KEY | 'ohos.extra.param.key.device_id' <br>**系统API**: 此接口为系统接口,三方应用不支持调用。 | 设备标识。 |
| DEVICE_ID_KEY | 'ohos.extra.param.key.device_id' | 设备标识。 <br>**系统API**: 此接口为系统接口,三方应用不支持调用。 |
| BUNDLE_NAME_KEY | 'ohos.extra.param.key.bundle_name' | 指示指定要获取的捆绑Bundle名称的键。 |
| LAUNCH_REASON_KEY<sup>10+</sup> | 'ohos.extra.param.key.form_launch_reason' | 卡片创建原因。 |
| PARAM_FORM_CUSTOMIZE_KEY<sup>10+</sup> | 'ohos.extra.param.key.form_customize' | 自定义数据。 |
......@@ -128,9 +127,9 @@ import formInfo from '@ohos.app.form.formInfo';
**系统能力**:SystemCapability.Ability.Form
| 名称 | 类型 | 说明 |
| ----------- | ---- | ------------ |
| moduleName | string | 选填。仅保留moduleName与提供值相符的卡片信息。<br>未填写时则不通过moduleName进行过滤。 |
| 名称 | 类型 | 必填 |说明 |
| ----------- | ---- | ------------ |------------ |
| moduleName | string |否 | 选填。仅保留moduleName与提供值相符的卡片信息。<br>未填写时则不通过moduleName进行过滤。 |
## VisibilityType
......@@ -140,7 +139,7 @@ import formInfo from '@ohos.app.form.formInfo';
| 名称 | 值 | 说明 |
| ----------- | ---- | ------------ |
| UNKNOWN | 0 | 表示卡片为未知。 |
| UNKNOWN<sup>10+</sup> | 0 | 表示卡片为未知。 |
| FORM_VISIBLE | 1 | 表示卡片为可见。 |
| FORM_INVISIBLE | 2 | 表示卡片为不可见。 |
......@@ -150,6 +149,8 @@ import formInfo from '@ohos.app.form.formInfo';
**系统能力**:SystemCapability.Ability.Form
**系统API**: 此接口为系统接口,三方应用不支持调用。
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ |
| formId | string | 是 | 否 | 卡片标识。 |
......
......@@ -539,7 +539,7 @@ isRequestPublishFormSupported(callback: AsyncCallback&lt;boolean&gt;): void
| 错误码ID | 错误信息 |
| -------- | -------- |
| 202 | The application is not a system application. |
| 202 | If the application is not a system application. |
| 401 | If the input parameter is not valid parameter. |
| 16500050 | An IPC connection error happened. |
| 16501000 | An internal functional error occurred. |
......@@ -602,7 +602,7 @@ isRequestPublishFormSupported(): Promise&lt;boolean&gt;
| 错误码ID | 错误信息 |
| -------- | -------- |
| 202 | The application is not a system application. |
| 202 | If the application is not a system application. |
| 16500050 | An IPC connection error happened. |
| 16501000 | An internal functional error occurred. |
......
......@@ -9,6 +9,12 @@ StaticSubscriberExtensionContext模块提供StaticSubscriberExtensionAbility具
> 本模块首批接口从API version 10开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。
## 导入模块
```ts
import StaticSubscriberExtensionContext from '@ohos.application.StaticSubscriberExtensionContext'
```
## 使用说明
在使用StaticSubscriberExtensionContext的功能前,需要通过StaticSubscriberExtensionAbility获取。
......
......@@ -404,7 +404,7 @@ killProcessWithAccount(bundleName: string, accountId: number): Promise\<void\>
>
> 当accountId为当前用户时,不需要校验ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS权限。
**需要权限**:ohos.permission.CLEAN_BACKGROUND_PROCESSESohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**需要权限**:ohos.permission.CLEAN_BACKGROUND_PROCESSES, ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -446,7 +446,7 @@ killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCal
**系统API**: 此接口为系统接口,三方应用不支持调用。
**需要权限**:ohos.permission.CLEAN_BACKGROUND_PROCESSESohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**需要权限**:ohos.permission.CLEAN_BACKGROUND_PROCESSES, ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**参数:**
......
......@@ -15,11 +15,13 @@ import StaticSubscriberExtensionAbility from '@ohos.application.StaticSubscriber
## 属性
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.AbilityCore
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**系统API**:该接口为系统接口,三方应用不支持调用。
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ------- | ------------------------------------------------------------ | ---- | ---- | -------- |
| context | [StaticSubscriberExtensionContext](js-apis-application-StaticSubscriberExtensionContext.md) | 是 | 否 | 上下文。 |
| context<sup>10+</sup> | [StaticSubscriberExtensionContext](js-apis-application-StaticSubscriberExtensionContext.md) | 是 | 否 | 上下文。 |
## StaticSubscriberExtensionAbility.onReceiveEvent
......
......@@ -14,11 +14,13 @@ Mission迁移完成后调用,返回迁移结果。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Mission
**系统API**:该接口为系统接口,三方应用不支持调用。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| result | number | | 迁移任务的结果。 |
| result | number | | 迁移任务的结果。 |
**示例:**
......
......@@ -23,7 +23,7 @@ import common from '@ohos.app.ability.common';
import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.app.form.formBindingData';
class MyFormExtensionAbility extends FormExtensionAbility {
export default class MyFormExtensionAbility extends FormExtensionAbility {
onAddForm(want) {
let formContext = this.context; // 获取FormExtensionContext
// ...
......
......@@ -1617,8 +1617,8 @@ startAbilityByCallWithAccount(want: Want, accountId: number): Promise&lt;Caller&
let want = {
bundleName: 'com.acts.actscalleeabilityrely',
moduleName: 'entry',
abilityName: 'EntryAbility'
deviceId: ''
abilityName: 'EntryAbility',
deviceId: '',
parameters: {
// 'ohos.aafwk.param.callAbilityToForeground' 值设置为true时为前台启动, 设置false或不设置为后台启动
'ohos.aafwk.param.callAbilityToForeground': true
......
......@@ -1228,7 +1228,7 @@ terminateSelf(): Promise&lt;void&gt;;
// 处理业务逻辑错误
console.error(`terminateSelf failed, code is ${err.code}, message is ${err.message}`);
});
} catch (error) {
} catch (err) {
// 捕获同步的参数错误
console.error(`terminateSelf failed, code is ${err.code}, message is ${err.message}`);
}
......@@ -2577,8 +2577,8 @@ startAbilityByCallWithAccount(want: Want, accountId: number): Promise&lt;Caller&
let want = {
bundleName: 'com.acts.actscalleeabilityrely',
moduleName: 'entry',
abilityName: 'EntryAbility'
deviceId: ''
abilityName: 'EntryAbility',
deviceId: '',
parameters: {
// 'ohos.aafwk.param.callAbilityToForeground' 值设置为true时为前台启动, 设置false或不设置为后台启动
'ohos.aafwk.param.callAbilityToForeground': true
......
......@@ -17,12 +17,16 @@ import uriPermissionManager from '@ohos.application.uriPermissionManager';
## uriPermissionManager.grantUriPermission
grantUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number, callback: AsyncCallback&lt;number&gt;): void
grantUriPermission(uri: string, flag: wantConstant.Flags, targetBundleName: string, callback: AsyncCallback&lt;number&gt;): void;
授权URI给指定应用,通过callback返回结果。
**系统API**:该接口为系统接口,三方应用不支持调用。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**需要权限:** ohos.permission.PROXY_AUTHORIZATION_URI
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -32,6 +36,18 @@ grantUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number,
| targetBundleName | string | 是 | 被授权URI的应用包名 |
| callback | AsyncCallback&lt;number&gt; | 是 | callback形式返回检验结果,返回0表示有权限,返回-1表示无权限。 |
**错误码:**
| 错误码ID | 错误信息 |
| -------- | -------- |
| 201 | Permissions denied. |
| 202 | Not System App. Interface caller is not a system app. |
| 401 | The parameter check failed. |
| 16500050 | Internal error. |
| 16500058 | Invalid URI flag. |
| 16500059 | Invalid URI type. |
| 16500060 | Sandbox application can not grant URI permission. |
**示例:**
```js
......@@ -46,12 +62,16 @@ grantUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number,
## uriPermissionManager.grantUriPermission
grantUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number): Promise&lt;number&gt;
grantUriPermission(uri: string, flag: wantConstant.Flags, targetBundleName: string): Promise&lt;number&gt;
授权URI给指定应用,通过返回值返回结果。
**系统API**:该接口为系统接口,三方应用不支持调用。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**需要权限:** ohos.permission.PROXY_AUTHORIZATION_URI
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -66,13 +86,25 @@ grantUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number)
| -------- | -------- |
| Promise&lt;number&gt; | 返回0表示有权限,返回-1表示无权限。 |
**错误码:**
| 错误码ID | 错误信息 |
| -------- | -------- |
| 201 | Permissions denied. |
| 202 | Not System App. Interface caller is not a system app. |
| 401 | The parameter check failed. |
| 16500050 | Internal error. |
| 16500058 | Invalid URI flag. |
| 16500059 | Invalid URI type. |
| 16500060 | Sandbox application can not grant URI permission. |
**示例:**
```js
import WantConstant from '@ohos.ability.wantConstant';
let targetBundleName = 'com.example.test_case1'
let uri = "fileshare:///com.samples.filesharetest.FileShare/person/10"
uriPermissionManager.grantUriPermission(uri, wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION, targetBundleName)
uriPermissionManager.grantUriPermission(uri, WantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION, targetBundleName)
.then((data) => {
console.log('Verification succeeded.' + data)
}).catch((error) => {
......@@ -81,12 +113,16 @@ grantUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number)
```
## uriPermissionManager.revokeUriPermission
revokeUriPermission(uri: string, accessTokenId: number, callback: AsyncCallback&lt;number&gt;): void
revokeUriPermission(uri: string, targetBundleName: string, callback: AsyncCallback&lt;number&gt;): void;
撤销授权指定应用的URI,通过callback返回结果。
**系统API**:该接口为系统接口,三方应用不支持调用。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**需要权限:** ohos.permission.PROXY_AUTHORIZATION_URI
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -95,13 +131,22 @@ revokeUriPermission(uri: string, accessTokenId: number, callback: AsyncCallback&
| targetBundleName | string | 是 | 被撤销授权uri的应用包名 |
| callback | AsyncCallback&lt;number&gt; | 是 | callback形式返回检验结果,返回0表示有权限,返回-1表示无权限。 |
**错误码:**
| 错误码ID | 错误信息 |
| -------- | -------- |
| 201 | Permissions denied. |
| 202 | Not System App. Interface caller is not a system app. |
| 401 | The parameter check failed. |
| 16500059 | Invalid URI type. |
**示例:**
```js
import WantConstant from '@ohos.ability.wantConstant';
let targetBundleName = 'com.example.test_case1'
let URI = "fileshare:///com.samples.filesharetest.FileShare/person/10"
uriPermissionManager.revokeUriPermission(uri, targetBundleName, (result) => {
uriPermissionManager.revokeUriPermission(URI, targetBundleName, (result) => {
console.log("result.code = " + result.code)
})
```
......@@ -109,12 +154,17 @@ revokeUriPermission(uri: string, accessTokenId: number, callback: AsyncCallback&
## uriPermissionManager.revokeUriPermission
revokeUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number): Promise&lt;number&gt;
revokeUriPermission(uri: string, targetBundleName: string): Promise&lt;number&gt;
撤销授权指定应用的URI,通过返回值返回结果。
**系统API**:该接口为系统接口,三方应用不支持调用。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**需要权限:** ohos.permission.PROXY_AUTHORIZATION_URI
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -128,6 +178,15 @@ revokeUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number
| -------- | -------- |
| Promise&lt;number&gt; | 返回0表示有权限,返回-1表示无权限。 |
**错误码:**
| 错误码ID | 错误信息 |
| -------- | -------- |
| 201 | Permissions denied. |
| 202 | Not System App. Interface caller is not a system app. |
| 401 | The parameter check failed. |
| 16500059 | Invalid URI type. |
**示例:**
```js
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册