Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
51aabc9c
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
51aabc9c
编写于
12月 05, 2022
作者:
Z
zhongjianfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify docs bugs
Signed-off-by:
N
zhongjianfei
<
zhongjianfei@huawei.com
>
上级
0ff906ad
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
35 addition
and
35 deletion
+35
-35
zh-cn/application-dev/application-models/application-context-stage.md
...ation-dev/application-models/application-context-stage.md
+3
-3
zh-cn/application-dev/application-models/common-event-subscription.md
...ation-dev/application-models/common-event-subscription.md
+1
-1
zh-cn/application-dev/application-models/context-switch.md
zh-cn/application-dev/application-models/context-switch.md
+11
-11
zh-cn/application-dev/application-models/dataability-switch.md
.../application-dev/application-models/dataability-switch.md
+1
-1
zh-cn/application-dev/application-models/featureability-switch.md
...plication-dev/application-models/featureability-switch.md
+8
-8
zh-cn/application-dev/application-models/lifecycleapp-switch.md
...application-dev/application-models/lifecycleapp-switch.md
+10
-10
zh-cn/application-dev/application-models/resourcemanager-switch.md
...lication-dev/application-models/resourcemanager-switch.md
+1
-1
未找到文件。
zh-cn/application-dev/application-models/application-context-stage.md
浏览文件 @
51aabc9c
...
...
@@ -68,7 +68,7 @@
-
[
获取和修改加密分区
](
#获取和修改加密分区
)
-
[
创建其他应用
/其他Module的Context
](
#创建其他应用
其他module的context
)
-
[
创建其他应用
或其他Module的Context
](
#创建其他应用或
其他module的context
)
-
[
订阅进程内Ability生命周期变化
](
#订阅进程内ability生命周期变化
)
...
...
@@ -168,9 +168,9 @@ export default class EntryAbility extends UIAbility {
```
### 创建其他应用
/
其他Module的Context
### 创建其他应用
或
其他Module的Context
基类Context提供创建其他应用
/
其他Module的Context的方法有
[
createBundleContext(bundleName:string)
](
../reference/apis/js-apis-application-context.md#contextcreatebundlecontext
)
、
[
createModuleContext(moduleName:string)
](
../reference/apis/js-apis-application-context.md#contextcreatemodulecontext
)
和
[
createModuleContext(bundleName:string, moduleName:string)
](
../reference/apis/js-apis-application-context.md#contextcreatemodulecontext-1
)
接口,创建其他应用或者其他Module的Context,从而通过该Context获取相应的资源信息(例如获取其他Module的
[
获取应用开发路径
](
#获取应用开发路径
)
信息)。
基类Context提供创建其他应用
或
其他Module的Context的方法有
[
createBundleContext(bundleName:string)
](
../reference/apis/js-apis-application-context.md#contextcreatebundlecontext
)
、
[
createModuleContext(moduleName:string)
](
../reference/apis/js-apis-application-context.md#contextcreatemodulecontext
)
和
[
createModuleContext(bundleName:string, moduleName:string)
](
../reference/apis/js-apis-application-context.md#contextcreatemodulecontext-1
)
接口,创建其他应用或者其他Module的Context,从而通过该Context获取相应的资源信息(例如获取其他Module的
[
获取应用开发路径
](
#获取应用开发路径
)
信息)。
-
调用createBundleContext(bundleName:string)方法,创建其他应用的Context信息。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
...
...
zh-cn/application-dev/application-models/common-event-subscription.md
浏览文件 @
51aabc9c
...
...
@@ -3,7 +3,7 @@
## 场景介绍
当需要订阅某个公共事件,获取该公共事件传递的参数时,需要创建一个订阅者对象,用于作为订阅公共事件的载体,订阅公共事件并获取公共事件传递而来的参数。订阅部分系统公共事件需要先
[
申请权限
](
../security/accesstoken-guidelines.md
)
,订阅这些事件所需要的权限请见
[
公共事件权限列表
](
../reference/apis/js-apis-commonEvent.md#
%E6%9D%83%E9%99%90%E5%88%97%E8%A1%A8
)
。
当需要订阅某个公共事件,获取该公共事件传递的参数时,需要创建一个订阅者对象,用于作为订阅公共事件的载体,订阅公共事件并获取公共事件传递而来的参数。订阅部分系统公共事件需要先
[
申请权限
](
../security/accesstoken-guidelines.md
)
,订阅这些事件所需要的权限请见
[
公共事件权限列表
](
../reference/apis/js-apis-commonEvent.md#
Support
)
。
## 接口说明
...
...
zh-cn/application-dev/application-models/context-switch.md
浏览文件 @
51aabc9c
...
...
@@ -5,24 +5,24 @@
| -------- | -------- | -------- |
|
[
getOrCreateLocalDir(callback:AsyncCallback<string>):void;
](
../reference/apis/js-apis-Context.md#contextgetorcreatelocaldir7
)
<br/>
[
getOrCreateLocalDir():Promise<string>;
](
../reference/apis/js-apis-Context.md#contextgetorcreatelocaldir7-1
)
| Stage模型无对应接口 | Stage模型应用在应用根目录下没有操作权限,不提供对应接口 |
|
[
verifyPermission(permission:string,options:PermissionOptions,callback:AsyncCallback<number>):void;
](
../reference/apis/js-apis-Context.md#contextverifypermission7
)
<br/>[verifyPermission(permission:string,callback:AsyncCallback<number>):void;](../reference/apis/js-apis-Context.md#contextverifypermission7-1)<br/>[verifyPermission(permission:string,options?:PermissionOptions):Promise<number>;](../reference/apis/js-apis-Context.md#contextverifypermission7-2) | \@ohos.abilityAccessCtrl.d.ts | [verifyAccessTokenSync(tokenID: number, permissionName: Permissions): GrantStatus;](../reference/apis/js-apis-abilityAccessCtrl.md#verifyaccesstokensync9)<br/>
[
verifyAccessToken(tokenID: number, permissionName: Permissions): Promise<GrantStatus>;
](
../reference/apis/js-apis-abilityAccessCtrl.md#verifyaccesstoken9
)
|
|
[
requestPermissionsFromUser(permissions:Array<string>,requestCode:number,resultCallback:AsyncCallback<PermissionRequestResult>):void;
](
../reference/apis/js-apis-Context.md#contextrequestpermissionsfromuser7
)
<br/>
[
requestPermissionsFromUser(permissions:Array<string>,requestCode:number):Promise<PermissionRequestResult>;
](
../reference/apis/js-apis-Context.md#contextrequestpermissionsfromuser7-1
)
| application
\U
IAbilityContext.d.ts |
[
requestPermissionsFromUser(permissions: Array<string>, requestCallback: AsyncCallback<PermissionRequestResult>) : void;
](
../reference/apis/js-apis-
inner-application-uiAbilityContext.md#abilitycontextrequestpermissionsfromuser
)
<br/>
[
requestPermissionsFromUser(permissions: Array<string>) : Promise<PermissionRequestResult>;
](
../reference/apis/js-apis-inner-application-uiAbilityC
ontext.md#abilitycontextrequestpermissionsfromuser-1
)
|
|
[
getApplicationInfo(callback:AsyncCallback<ApplicationInfo>):void;
](
../reference/apis/js-apis-Context.md#contextgetapplicationinfo7
)
<br/>
[
getApplicationInfo():Promise<ApplicationInfo>;
](
../reference/apis/js-apis-Context.md#contextgetapplicationinfo7-1
)
| application
\C
ontext.d.ts |
[
applicationInfo: ApplicationInfo;
](
../reference/apis/js-apis-
inner-
application-context.md#属性
)
|
|
[
getBundleName(callback : AsyncCallback<string>): void;
](
../reference/apis/js-apis-Context.md#contextgetbundlename7
)
<br/>
[
getBundleName(): Promise<string>;
](
../reference/apis/js-apis-Context.md#contextgetbundlename7-1
)
| application
\U
IAbilityContext.d.ts |
[
abilityInfo.bundleName: string;
](
../reference/apis/js-apis-
inner-application-uiAbilityC
ontext.md#属性
)
|
|
[
requestPermissionsFromUser(permissions:Array<string>,requestCode:number,resultCallback:AsyncCallback<PermissionRequestResult>):void;
](
../reference/apis/js-apis-Context.md#contextrequestpermissionsfromuser7
)
<br/>
[
requestPermissionsFromUser(permissions:Array<string>,requestCode:number):Promise<PermissionRequestResult>;
](
../reference/apis/js-apis-Context.md#contextrequestpermissionsfromuser7-1
)
| application
\U
IAbilityContext.d.ts |
[
requestPermissionsFromUser(permissions: Array<string>, requestCallback: AsyncCallback<PermissionRequestResult>) : void;
](
../reference/apis/js-apis-
ability-context.md#abilitycontextrequestpermissionsfromuser
)
<br/>
[
requestPermissionsFromUser(permissions: Array<string>) : Promise<PermissionRequestResult>;
](
../reference/apis/js-apis-ability-c
ontext.md#abilitycontextrequestpermissionsfromuser-1
)
|
|
[
getApplicationInfo(callback:AsyncCallback<ApplicationInfo>):void;
](
../reference/apis/js-apis-Context.md#contextgetapplicationinfo7
)
<br/>
[
getApplicationInfo():Promise<ApplicationInfo>;
](
../reference/apis/js-apis-Context.md#contextgetapplicationinfo7-1
)
| application
\C
ontext.d.ts |
[
applicationInfo: ApplicationInfo;
](
../reference/apis/js-apis-application-context.md#属性
)
|
|
[
getBundleName(callback : AsyncCallback<string>): void;
](
../reference/apis/js-apis-Context.md#contextgetbundlename7
)
<br/>
[
getBundleName(): Promise<string>;
](
../reference/apis/js-apis-Context.md#contextgetbundlename7-1
)
| application
\U
IAbilityContext.d.ts |
[
abilityInfo.bundleName: string;
](
../reference/apis/js-apis-
ability-c
ontext.md#属性
)
|
|
[
getDisplayOrientation(callback : AsyncCallback<bundle.DisplayOrientation>): void;
](
../reference/apis/js-apis-Context.md#contextgetdisplayorientation7
)
<br/>
[
getDisplayOrientation(): Promise<bundle.DisplayOrientation>;
](
../reference/apis/js-apis-Context.md#contextgetdisplayorientation7-1
)
|
\@
ohos.screen.d.ts |
[
readonly orientation: Orientation;
](
../reference/apis/js-apis-screen.md#orientation
)
|
|
[
setDisplayOrientation(orientation:bundle.DisplayOrientation, callback:AsyncCallback<void>):void;
](
../reference/apis/js-apis-Context.md#contextsetdisplayorientation7
)
<br/>[setDisplayOrientation(orientation:bundle.DisplayOrientation):Promise<void>;](../reference/apis/js-apis-Context.md#contextsetdisplayorientation7-1) | \@ohos.screen.d.ts | [setOrientation(orientation: Orientation, callback: AsyncCallback<void>): void;](../reference/apis/js-apis-screen.md#setorientation)<br/>
[
setOrientation(orientation: Orientation): Promise<void>;
](
../reference/apis/js-apis-screen.md#setorientation-1
)
|
|
[
setShowOnLockScreen(show:boolean, callback:AsyncCallback<void>):void;
](
../reference/apis/js-apis-Context.md#contextsetshowonlockscreen7
)
<br/>
[
setShowOnLockScreen(show:boolean):Promise<void>;
](
../reference/apis/js-apis-Context.md#contextsetshowonlockscreen7-1
)
|
\@
ohos.window.d.ts |
[
setShowOnLockScreen(showOnLockScreen: boolean): void;
](
../reference/apis/js-apis-window.md#setshowonlockscreen9
)
|
|
[
setWakeUpScreen(wakeUp:boolean, callback:AsyncCallback<void>):void;
](
../reference/apis/js-apis-Context.md#contextsetwakeupscreen7
)
<br/>
[
setWakeUpScreen(wakeUp:boolean):Promise<void>;
](
../reference/apis/js-apis-Context.md#contextsetwakeupscreen7-1
)
|
\@
ohos.window.d.ts |
[
setWakeUpScreen(wakeUp: boolean): void;
](
../reference/apis/js-apis-window.md#setwakeupscreen9
)
|
|
[
getProcessInfo(callback:AsyncCallback<ProcessInfo>):void;
](
../reference/apis/js-apis-Context.md#contextgetprocessinfo7
)
<br/>[getProcessInfo():Promise<ProcessInfo>;](../reference/apis/js-apis-Context.md#contextgetprocessinfo7-1) | \@ohos.app.ability.abilityManager.d.ts | [getAbilityRunningInfos(callback: AsyncCallback<Array<AbilityRunningInfo>>): void;](../reference/apis/js-apis-app-ability-abilityManager.md#getabilityrunninginfos)<br/>
[
getAbilityRunningInfos(): Promise<Array<AbilityRunningInfo>>;
](
../reference/apis/js-apis-app-ability-abilityManager.md#getabilityrunninginfos-1
)
|
|
[
getElementName(callback:AsyncCallback<ElementName>):void;
](
../reference/apis/js-apis-Context.md#contextgetelementname7
)
<br/>
[
getElementName():Promise<ElementName>;
](
../reference/apis/js-apis-Context.md#contextgetelementname7-1
)
| application
\U
IAbilityContext.d.ts |
[
abilityInfo.name: string;
](
../reference/apis/js-apis-
inner-application-uiAbilityContext.md#属性
)
<br/>
[
abilityInfo.bundleName: string;
](
../reference/apis/js-apis-inner-application-uiAbilityC
ontext.md#属性
)
|
|
[
getElementName(callback:AsyncCallback<ElementName>):void;
](
../reference/apis/js-apis-Context.md#contextgetelementname7
)
<br/>
[
getElementName():Promise<ElementName>;
](
../reference/apis/js-apis-Context.md#contextgetelementname7-1
)
| application
\U
IAbilityContext.d.ts |
[
abilityInfo.name: string;
](
../reference/apis/js-apis-
ability-context.md#属性
)
<br/>
[
abilityInfo.bundleName: string;
](
../reference/apis/js-apis-ability-c
ontext.md#属性
)
|
|
[
getProcessName(callback:AsyncCallback<string>):void;
](
../reference/apis/js-apis-Context.md#contextgetprocessname7
)
<br/>[getProcessName():Promise<string>;](../reference/apis/js-apis-Context.md#contextgetprocessname7-1) | \@ohos.app.ability.abilityManager.d.ts | [getAbilityRunningInfos(callback: AsyncCallback<Array<AbilityRunningInfo>>): void;](../reference/apis/js-apis-app-ability-abilityManager.md#getabilityrunninginfos)<br/>
[
getAbilityRunningInfos(): Promise<Array<AbilityRunningInfo>>;
](
../reference/apis/js-apis-app-ability-abilityManager.md#getabilityrunninginfos-1
)
|
|
[
getCallingBundle(callback:AsyncCallback<string>):void;
](
../reference/apis/js-apis-Context.md#contextgetcallingbundle7
)
<br/>
[
getCallingBundle():Promise<string>;
](
../reference/apis/js-apis-Context.md#contextgetcallingbundle7-1
)
| Stage模型无对应接口 | Stage模型应用可以使用Want.parameters的ohos.aafwk.param.callerUid参数,获取调用方的应用信息 |
|
[
getFilesDir(callback:AsyncCallback<string>):void;
](
../reference/apis/js-apis-Context.md#contextgetfilesdir
)
<br/>
[
getFilesDir():Promise<string>;
](
../reference/apis/js-apis-Context.md#contextgetfilesdir-1
)
| application
\C
ontext.d.ts |
[
filesDir: string;
](
../reference/apis/js-apis-
inner-
application-context.md#属性
)
|
|
[
getCacheDir(callback:AsyncCallback<string>):void;
](
../reference/apis/js-apis-Context.md#contextgetcachedir
)
<br/>
[
getCacheDir():Promise<string>;
](
../reference/apis/js-apis-Context.md#contextgetcachedir-1
)
| application
\C
ontext.d.ts |
[
cacheDir: string;
](
../reference/apis/js-apis-
inner-
application-context.md#属性
)
|
|
[
getOrCreateDistributedDir(callback:AsyncCallback<string>):void;
](
../reference/apis/js-apis-Context.md#contextgetorcreatedistributeddir7
)
<br/>
[
getOrCreateDistributedDir():Promise<string>;
](
../reference/apis/js-apis-Context.md#contextgetorcreatedistributeddir7-1
)
| application
\C
ontext.d.ts |
[
distributedFilesDir: string;
](
../reference/apis/js-apis-
inner-
application-context.md#属性
)
|
|
[
getAppType(callback:AsyncCallback<string>):void;
](
../reference/apis/js-apis-Context.md#contextgetapptype7
)
<br/>
[
getAppType():Promise<string>;
](
../reference/apis/js-apis-Context.md#contextgetapptype7-1
)
| application
\U
IAbilityContext.d.ts | 通过abilityInfo字段的type属性获取
<br/>
[
abilityInfo.type: bundleManager.AbilityType;
](
../reference/apis/js-apis-
inner-application-uiAbilityC
ontext.md#属性
)
|
|
[
getHapModuleInfo(callback:AsyncCallback<HapModuleInfo>):void;
](
../reference/apis/js-apis-Context.md#contextgethapmoduleinfo7
)
<br/>
[
getHapModuleInfo():Promise<HapModuleInfo>;
](
../reference/apis/js-apis-Context.md#contextgethapmoduleinfo7-1
)
| application
\U
IAbilityContext.d.ts |
[
currentHapModuleInfo: HapModuleInfo;
](
../reference/apis/js-apis-
inner-application-uiAbilityC
ontext.md#属性
)
|
|
[
getFilesDir(callback:AsyncCallback<string>):void;
](
../reference/apis/js-apis-Context.md#contextgetfilesdir
)
<br/>
[
getFilesDir():Promise<string>;
](
../reference/apis/js-apis-Context.md#contextgetfilesdir-1
)
| application
\C
ontext.d.ts |
[
filesDir: string;
](
../reference/apis/js-apis-application-context.md#属性
)
|
|
[
getCacheDir(callback:AsyncCallback<string>):void;
](
../reference/apis/js-apis-Context.md#contextgetcachedir
)
<br/>
[
getCacheDir():Promise<string>;
](
../reference/apis/js-apis-Context.md#contextgetcachedir-1
)
| application
\C
ontext.d.ts |
[
cacheDir: string;
](
../reference/apis/js-apis-application-context.md#属性
)
|
|
[
getOrCreateDistributedDir(callback:AsyncCallback<string>):void;
](
../reference/apis/js-apis-Context.md#contextgetorcreatedistributeddir7
)
<br/>
[
getOrCreateDistributedDir():Promise<string>;
](
../reference/apis/js-apis-Context.md#contextgetorcreatedistributeddir7-1
)
| application
\C
ontext.d.ts |
[
distributedFilesDir: string;
](
../reference/apis/js-apis-application-context.md#属性
)
|
|
[
getAppType(callback:AsyncCallback<string>):void;
](
../reference/apis/js-apis-Context.md#contextgetapptype7
)
<br/>
[
getAppType():Promise<string>;
](
../reference/apis/js-apis-Context.md#contextgetapptype7-1
)
| application
\U
IAbilityContext.d.ts | 通过abilityInfo字段的type属性获取
<br/>
[
abilityInfo.type: bundleManager.AbilityType;
](
../reference/apis/js-apis-
ability-c
ontext.md#属性
)
|
|
[
getHapModuleInfo(callback:AsyncCallback<HapModuleInfo>):void;
](
../reference/apis/js-apis-Context.md#contextgethapmoduleinfo7
)
<br/>
[
getHapModuleInfo():Promise<HapModuleInfo>;
](
../reference/apis/js-apis-Context.md#contextgethapmoduleinfo7-1
)
| application
\U
IAbilityContext.d.ts |
[
currentHapModuleInfo: HapModuleInfo;
](
../reference/apis/js-apis-
ability-c
ontext.md#属性
)
|
|
[
getAppVersionInfo(callback:AsyncCallback<AppVersionInfo>):void;
](
../reference/apis/js-apis-Context.md#contextgetappversioninfo7
)
<br/>
[
getAppVersionInfo():Promise<AppVersionInfo>;
](
../reference/apis/js-apis-Context.md#contextgetappversioninfo7-1
)
| bundle
\b
undleInfo.d.ts |
[
readonly name: string;
](
../reference/apis/js-apis-bundleManager-bundleInfo.md#bundleinfo-1
)
<br/>
[
readonly versionCode: number;
](
../reference/apis/js-apis-bundleManager-bundleInfo.md#bundleinfo-1
)
<br/>
[
readonly versionName: string;
](
../reference/apis/js-apis-bundleManager-bundleInfo.md#bundleinfo-1
)
|
|
[
getApplicationContext():Context;
](
../reference/apis/js-apis-Context.md#contextgetapplicationcontext7
)
| application
\C
ontext.d.ts |
[
getApplicationContext(): ApplicationContext;
](
../reference/apis/js-apis-
inner-
application-context.md#contextgetapplicationcontext
)
|
|
[
getAbilityInfo(callback:AsyncCallback<AbilityInfo>):void;
](
../reference/apis/js-apis-Context.md#contextgetabilityinfo7
)
<br/>
[
getAbilityInfo():Promise<AbilityInfo>;
](
../reference/apis/js-apis-Context.md#contextgetabilityinfo7-1
)
| application
\U
IAbilityContext.d.ts |
[
abilityInfo: AbilityInfo;
](
../reference/apis/js-apis-
inner-application-uiAbilityC
ontext.md#属性
)
|
|
[
getApplicationContext():Context;
](
../reference/apis/js-apis-Context.md#contextgetapplicationcontext7
)
| application
\C
ontext.d.ts |
[
getApplicationContext(): ApplicationContext;
](
../reference/apis/js-apis-application-context.md#contextgetapplicationcontext
)
|
|
[
getAbilityInfo(callback:AsyncCallback<AbilityInfo>):void;
](
../reference/apis/js-apis-Context.md#contextgetabilityinfo7
)
<br/>
[
getAbilityInfo():Promise<AbilityInfo>;
](
../reference/apis/js-apis-Context.md#contextgetabilityinfo7-1
)
| application
\U
IAbilityContext.d.ts |
[
abilityInfo: AbilityInfo;
](
../reference/apis/js-apis-
ability-c
ontext.md#属性
)
|
|
[
isUpdatingConfigurations(callback:AsyncCallback<boolean>):void;
](
../reference/apis/js-apis-Context.md#contextisupdatingconfigurations7
)
<br/>
[
isUpdatingConfigurations():Promise<boolean>;
](
../reference/apis/js-apis-Context.md#contextisupdatingconfigurations7-1
)
| Stage模型无对应接口 | OpenHarmony在系统环境变化时,应用不会重启,调用onConfigurationUpdated接口通知应用,该接口在FA模型是空实现接口,Stage模型不提供对应接口 |
|
[
printDrawnCompleted(callback:AsyncCallback<void>):void;
](
../reference/apis/js-apis-Context.md#contextprintdrawncompleted7
)
<br/>
[
printDrawnCompleted():Promise<void>;
](
../reference/apis/js-apis-Context.md#contextprintdrawncompleted7-1
)
| Stage模型无对应接口 | 该接口在FA模型是空实现接口,不影响应用功能,Stage模型不提供对应接口 |
zh-cn/application-dev/application-models/dataability-switch.md
浏览文件 @
51aabc9c
...
...
@@ -38,5 +38,5 @@ Stage模型三方应用不能对其他三方提供数据,应用需要根据具
| DataAbility业务类型 | 切换DataShareExtension策略 |
| -------- | -------- |
| 对三方提供数据 | 需根据业务场景匹配到系统对应的场景化
[
ExtensionAbility
](
../reference/apis/js-apis-
Bundle.md#extensionabilitytype9
)
。 |
| 对三方提供数据 | 需根据业务场景匹配到系统对应的场景化
[
ExtensionAbility
](
../reference/apis/js-apis-
bundleManager.md#extensionabilitytype
)
。 |
| 应用内使用的数据 | 对应用内其他组件提供数据,建议提取公共模块。 |
zh-cn/application-dev/application-models/featureability-switch.md
浏览文件 @
51aabc9c
...
...
@@ -3,14 +3,14 @@
| FA模型接口 | Stage模型接口对应d.ts文件 | Stage模型对应接口 |
| -------- | -------- | -------- |
|
[
getWant(callback: AsyncCallback<Want>): void;
](
../reference/apis/js-apis-featureAbility.md#featureabilitygetwant
)
<br/>
[
getWant(): Promise<Want>;
](
../reference/apis/js-apis-featureAbility.md#featureabilitygetwant-1
)
|
\@
ohos.app.ability.UIAbility.d.ts |
[
launchWant: Want;
](
../reference/apis/js-apis-app
-ability-uiA
bility.md#属性
)
|
|
[
startAbility(parameter: StartAbilityParameter, callback: AsyncCallback<number>): void;
](
../reference/apis/js-apis-featureAbility.md#featureabilitystartability
)
<br/>
[
startAbility(parameter: StartAbilityParameter): Promise<number>;
](
../reference/apis/js-apis-featureAbility.md#featureabilitystartability-1
)
| application
\U
IAbilityContext.d.ts |
[
startAbility(want: Want, callback: AsyncCallback<void>): void;
](
../reference/apis/js-apis-
inner-application-uiAbilityContext.md#abilitycontextstartability
)
<br/>
[
startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void;
](
../reference/apis/js-apis-inner-application-uiAbilityContext.md#abilitycontextstartability-1
)
<br/>
[
startAbility(want: Want, options?: StartOptions): Promise<void>;
](
../reference/apis/js-apis-inner-application-uiAbilityC
ontext.md#abilitycontextstartability-2
)
|
|
[
getContext(): Context;
](
../reference/apis/js-apis-featureAbility.md#featureabilitygetcontext
)
|
\@
ohos.app.ability.UIAbility.d.ts |
[
context: UIAbilityContext;
](
../reference/apis/js-apis-app
-ability-uiA
bility.md#属性
)
|
|
[
startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback<AbilityResult>): void;
](
../reference/apis/js-apis-featureAbility.md#featureabilitystartabilityforresult7
)
<br/>
[
startAbilityForResult(parameter: StartAbilityParameter): Promise<AbilityResult>;
](
../reference/apis/js-apis-featureAbility.md#featureabilitystartabilityforresult7-1
)
| application
\U
IAbilityContext.d.ts |
[
startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): void;
](
../reference/apis/js-apis-
inner-application-uiAbilityContext.md#abilitycontextstartabilityforresult
)
<br/>
[
startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback<AbilityResult>): void;
](
../reference/apis/js-apis-inner-application-uiAbilityContext.md#abilitycontextstartabilityforresult-1
)
<br/>
[
startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityResult>;
](
../reference/apis/js-apis-inner-application-uiAbilityC
ontext.md#abilitycontextstartabilityforresult-2
)
|
|
[
terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void;
](
../reference/apis/js-apis-featureAbility.md#featureabilityterminateselfwithresult7
)
<br/>
[
terminateSelfWithResult(parameter: AbilityResult): Promise<void>;
](
../reference/apis/js-apis-featureAbility.md#featureabilityterminateselfwithresult7-1
)
| application
\U
IAbilityContext.d.ts |
[
terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void;
](
../reference/apis/js-apis-
inner-application-uiAbilityContext.md#abilitycontextterminateselfwithresult
)
<br/>
[
terminateSelfWithResult(parameter: AbilityResult): Promise<void>;
](
../reference/apis/js-apis-inner-application-uiAbilityC
ontext.md#abilitycontextterminateselfwithresult-1
)
|
|
[
terminateSelf(callback: AsyncCallback<void>): void;
](
../reference/apis/js-apis-featureAbility.md#featureabilityterminateself7
)
<br/>
[
terminateSelf(): Promise<void>;
](
../reference/apis/js-apis-featureAbility.md#featureabilityterminateself7-1
)
| application
\U
IAbilityContext.d.ts |
[
terminateSelf(callback: AsyncCallback<void>): void;
](
../reference/apis/js-apis-
inner-application-uiAbilityContext.md#abilitycontextterminateself
)
<br/>
[
terminateSelf(): Promise<void>;
](
../reference/apis/js-apis-inner-application-uiAbilityC
ontext.md#abilitycontextterminateself-1
)
|
|
[
getWant(callback: AsyncCallback<Want>): void;
](
../reference/apis/js-apis-featureAbility.md#featureabilitygetwant
)
<br/>
[
getWant(): Promise<Want>;
](
../reference/apis/js-apis-featureAbility.md#featureabilitygetwant-1
)
|
\@
ohos.app.ability.UIAbility.d.ts |
[
launchWant: Want;
](
../reference/apis/js-apis-app
lication-a
bility.md#属性
)
|
|
[
startAbility(parameter: StartAbilityParameter, callback: AsyncCallback<number>): void;
](
../reference/apis/js-apis-featureAbility.md#featureabilitystartability
)
<br/>
[
startAbility(parameter: StartAbilityParameter): Promise<number>;
](
../reference/apis/js-apis-featureAbility.md#featureabilitystartability-1
)
| application
\U
IAbilityContext.d.ts |
[
startAbility(want: Want, callback: AsyncCallback<void>): void;
](
../reference/apis/js-apis-
ability-context.md#abilitycontextstartability
)
<br/>
[
startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void;
](
../reference/apis/js-apis-ability-context.md#abilitycontextstartability-1
)
<br/>
[
startAbility(want: Want, options?: StartOptions): Promise<void>;
](
../reference/apis/js-apis-ability-c
ontext.md#abilitycontextstartability-2
)
|
|
[
getContext(): Context;
](
../reference/apis/js-apis-featureAbility.md#featureabilitygetcontext
)
|
\@
ohos.app.ability.UIAbility.d.ts |
[
context: UIAbilityContext;
](
../reference/apis/js-apis-app
lication-a
bility.md#属性
)
|
|
[
startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback<AbilityResult>): void;
](
../reference/apis/js-apis-featureAbility.md#featureabilitystartabilityforresult7
)
<br/>
[
startAbilityForResult(parameter: StartAbilityParameter): Promise<AbilityResult>;
](
../reference/apis/js-apis-featureAbility.md#featureabilitystartabilityforresult7-1
)
| application
\U
IAbilityContext.d.ts |
[
startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): void;
](
../reference/apis/js-apis-
ability-context.md#abilitycontextstartabilityforresult
)
<br/>
[
startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback<AbilityResult>): void;
](
../reference/apis/js-apis-ability-context.md#abilitycontextstartabilityforresult-1
)
<br/>
[
startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityResult>;
](
../reference/apis/js-apis-ability-c
ontext.md#abilitycontextstartabilityforresult-2
)
|
|
[
terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void;
](
../reference/apis/js-apis-featureAbility.md#featureabilityterminateselfwithresult7
)
<br/>
[
terminateSelfWithResult(parameter: AbilityResult): Promise<void>;
](
../reference/apis/js-apis-featureAbility.md#featureabilityterminateselfwithresult7-1
)
| application
\U
IAbilityContext.d.ts |
[
terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void;
](
../reference/apis/js-apis-
ability-context.md#abilitycontextterminateselfwithresult
)
<br/>
[
terminateSelfWithResult(parameter: AbilityResult): Promise<void>;
](
../reference/apis/js-apis-ability-c
ontext.md#abilitycontextterminateselfwithresult-1
)
|
|
[
terminateSelf(callback: AsyncCallback<void>): void;
](
../reference/apis/js-apis-featureAbility.md#featureabilityterminateself7
)
<br/>
[
terminateSelf(): Promise<void>;
](
../reference/apis/js-apis-featureAbility.md#featureabilityterminateself7-1
)
| application
\U
IAbilityContext.d.ts |
[
terminateSelf(callback: AsyncCallback<void>): void;
](
../reference/apis/js-apis-
ability-context.md#abilitycontextterminateself
)
<br/>
[
terminateSelf(): Promise<void>;
](
../reference/apis/js-apis-ability-c
ontext.md#abilitycontextterminateself-1
)
|
|
[
acquireDataAbilityHelper(uri: string): DataAbilityHelper;
](
../reference/apis/js-apis-featureAbility.md#featureabilityacquiredataabilityhelper7
)
|
\@
ohos.data.dataShare.d.ts
<br/>\@ohos.data.fileAccess.d.ts | [createDataShareHelper(context: Context, uri: string, callback: AsyncCallback<DataShareHelper>): void;](../reference/apis/js-apis-data-dataShare.md#datasharecreatedatasharehelper)<br/>[createDataShareHelper(context: Context, uri: string): Promise<DataShareHelper>;](../reference/apis/js-apis-data-dataShare.md#datasharecreatedatasharehelper-1)<br/>[createFileAccessHelper(context: Context): FileAccessHelper;](../reference/apis/js-apis-fileAccess.md#fileaccesscreatefileaccesshelper-1)<br/>
[
createFileAccessHelper(context: Context, wants: Array<Want>): FileAccessHelper;
](
../reference/apis/js-apis-fileAccess.md#fileaccesscreatefileaccesshelper
)
|
|
[
hasWindowFocus(callback: AsyncCallback<boolean>): void;
](
../reference/apis/js-apis-featureAbility.md#featureabilityhaswindowfocus7
)
<br/>[hasWindowFocus(): Promise<boolean>;](../reference/apis/js-apis-featureAbility.md#featureabilityhaswindowfocus7-1) | \@ohos.window.d.ts | [on(eventType: 'windowStageEvent', callback: Callback<WindowStageEventType>): void;](../reference/apis/js-apis-window.md#onwindowstageevent9)<br/>
监听
[
Active
](
../reference/apis/js-apis-window.md#windowstageeventtype9
)
获焦状态 |
|
[
connectAbility(request: Want, options:ConnectOptions ): number;
](
../reference/apis/js-apis-featureAbility.md#featureabilityconnectability7
)
| application
\U
IAbilityContext.d.ts |
[
connectServiceExtensionAbility(want: Want, options: ConnectOptions): number;
](
../reference/apis/js-apis-
inner-application-uiAbilityC
ontext.md#abilitycontextconnectserviceextensionability
)
|
|
[
disconnectAbility(connection: number, callback:AsyncCallback<void>): void;
](
../reference/apis/js-apis-featureAbility.md#featureabilitydisconnectability7
)
<br/>
[
disconnectAbility(connection: number): Promise<void>;
](
../reference/apis/js-apis-featureAbility.md#featureabilitydisconnectability7-1
)
| application
\U
IAbilityContext.d.ts |
[
disconnectAbility(connection: number, callback:AsyncCallback<void>): void;
](
../reference/apis/js-apis-
inner-application-uiAbilityContext.md#abilitycontextdisconnectserviceextensionability-1
)
<br/>
[
disconnectAbility(connection: number): Promise<void>;
](
../reference/apis/js-apis-inner-application-uiAbilityC
ontext.md#abilitycontextdisconnectserviceextensionability
)
|
|
[
connectAbility(request: Want, options:ConnectOptions ): number;
](
../reference/apis/js-apis-featureAbility.md#featureabilityconnectability7
)
| application
\U
IAbilityContext.d.ts |
[
connectServiceExtensionAbility(want: Want, options: ConnectOptions): number;
](
../reference/apis/js-apis-
ability-c
ontext.md#abilitycontextconnectserviceextensionability
)
|
|
[
disconnectAbility(connection: number, callback:AsyncCallback<void>): void;
](
../reference/apis/js-apis-featureAbility.md#featureabilitydisconnectability7
)
<br/>
[
disconnectAbility(connection: number): Promise<void>;
](
../reference/apis/js-apis-featureAbility.md#featureabilitydisconnectability7-1
)
| application
\U
IAbilityContext.d.ts |
[
disconnectAbility(connection: number, callback:AsyncCallback<void>): void;
](
../reference/apis/js-apis-
ability-context.md#abilitycontextdisconnectserviceextensionability-1
)
<br/>
[
disconnectAbility(connection: number): Promise<void>;
](
../reference/apis/js-apis-ability-c
ontext.md#abilitycontextdisconnectserviceextensionability
)
|
|
[
getWindow(callback: AsyncCallback<window.Window>): void;
](
../reference/apis/js-apis-featureAbility.md#featureabilitygetwindow7
)
<br/>[getWindow(): Promise<window.Window>;](../reference/apis/js-apis-featureAbility.md#featureabilitygetwindow7-1) | \@ohos.window.d.ts | [getLastWindow(ctx: BaseContext, callback: AsyncCallback<Window>): void;](../reference/apis/js-apis-window.md#windowgetlastwindow9)<br/>
[
getLastWindow(ctx: BaseContext): Promise<Window>;
](
../reference/apis/js-apis-window.md#windowgetlastwindow9-1
)
|
zh-cn/application-dev/application-models/lifecycleapp-switch.md
浏览文件 @
51aabc9c
...
...
@@ -5,17 +5,17 @@
| -------- | -------- | -------- |
| onShow?():
void; |
\@
ohos.window.d.ts |
[
on(eventType: 'windowStageEvent', callback: Callback<WindowStageEventType>): void;
](
../reference/apis/js-apis-window.md#onwindowstageevent9
)
<br/>
监听
[
FOREGROUND
](
../reference/apis/js-apis-window.md#windowstageeventtype9
)
切到前台状态 |
| onHide?():
void; |
\@
ohos.window.d.ts |
[
on(eventType: 'windowStageEvent', callback: Callback<WindowStageEventType>): void;
](
../reference/apis/js-apis-window.md#onwindowstageevent9
)
<br/>
监听
[
BACKGROUND
](
../reference/apis/js-apis-window.md#windowstageeventtype9
)
切到后台状态 |
| onDestroy?():
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onDestroy(): void;
](
../reference/apis/js-apis-app
-ability-uiA
bility.md#abilityondestroy
)
|
| onCreate?():
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onCreate(want: Want, param: AbilityConstant.LaunchParam): void;
](
../reference/apis/js-apis-app
-ability-uiA
bility.md#abilityoncreate
)
|
| onDestroy?():
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onDestroy(): void;
](
../reference/apis/js-apis-app
lication-a
bility.md#abilityondestroy
)
|
| onCreate?():
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onCreate(want: Want, param: AbilityConstant.LaunchParam): void;
](
../reference/apis/js-apis-app
lication-a
bility.md#abilityoncreate
)
|
| onWindowDisplayModeChanged?(isShownInMultiWindow:
boolean,
newConfig:
resourceManager.Configuration):
void; | Stage模型无对应接口 | 暂时未提供对应接口 |
| onStartContinuation?():
boolean; | Stage模型无对应接口 | Stage模型上,应用无需感知迁移是否成功(由应用发起迁移请求时感知),onStartContinuation废弃 |
| onSaveData?(data:
Object):
boolean; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onContinue(wantParam : {[key: string]: any}): AbilityConstant.OnContinueResult;
](
../reference/apis/js-apis-app
-ability-uiA
bility.md#abilityoncontinue
)
|
| onSaveData?(data:
Object):
boolean; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onContinue(wantParam : {[key: string]: any}): AbilityConstant.OnContinueResult;
](
../reference/apis/js-apis-app
lication-a
bility.md#abilityoncontinue
)
|
| onCompleteContinuation?(result:
number):
void; | application
\C
ontinueCallback.d.ts |
[
onContinueDone(result: number): void;
](
../reference/apis/js-apis-distributedMissionManager.md#continuecallback
)
|
| onRestoreData?(data:
Object):
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onCreate(want: Want, param: AbilityConstant.LaunchParam): void;
](
../reference/apis/js-apis-app
-ability-uiAbility.md#abilityoncreate
)
<br/>
[
onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void;
](
../reference/apis/js-apis-app-ability-uiA
bility.md#abilityonnewwant
)
<br/>
标准实例模式Ability迁移目标端在onCreate回调中完成数据恢复,单实例应用迁移目标端在onCreate回调中完成数据恢复,回调中通过判断launchParam.launchReason可获取迁移启动的场景,从而可以从Want中获取迁移前保存的数据 |
| onRestoreData?(data:
Object):
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onCreate(want: Want, param: AbilityConstant.LaunchParam): void;
](
../reference/apis/js-apis-app
lication-ability.md#abilityoncreate
)
<br/>
[
onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void;
](
../reference/apis/js-apis-application-a
bility.md#abilityonnewwant
)
<br/>
标准实例模式Ability迁移目标端在onCreate回调中完成数据恢复,单实例应用迁移目标端在onCreate回调中完成数据恢复,回调中通过判断launchParam.launchReason可获取迁移启动的场景,从而可以从Want中获取迁移前保存的数据 |
| onRemoteTerminated?():
void; | application
\C
ontinueCallback.d.ts |
[
onContinueDone(result: number): void;
](
../reference/apis/js-apis-distributedMissionManager.md#continuecallback
)
|
| onSaveAbilityState?(outState:
PacMap):
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any}): AbilityConstant.OnSaveResult;
](
../reference/apis/js-apis-app
-ability-uiA
bility.md#abilityonsavestate
)
|
| onRestoreAbilityState?(inState:
PacMap):
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onCreate(want: Want, param: AbilityConstant.LaunchParam): void;
](
../reference/apis/js-apis-app
-ability-uiA
bility.md#abilityoncreate
)
<br/>
应用重启后会触发Ability的onCreate方法,通过判断launchParam.launchReason可获取自恢复的场景,从而可以从Want中获取重启前保存的数据 |
| onInactive?():
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onBackground(): void;
](
../reference/apis/js-apis-app
-ability-uiA
bility.md#abilityonbackground
)
|
| onActive?():
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onForeground(): void;
](
../reference/apis/js-apis-app
-ability-uiA
bility.md#abilityonforeground
)
|
| onNewWant?(want:
Want):
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void;
](
../reference/apis/js-apis-app
-ability-uiA
bility.md#abilityonnewwant
)
|
| onMemoryLevel?(level:
number):
void |
\@
ohos.app.ability.UIAbility.d.ts |
[
onMemoryLevel(level: AbilityConstant.MemoryLevel): void;
](
../reference/apis/js-apis-app
-ability-uiA
bility.md#abilityonmemorylevel
)
|
| onSaveAbilityState?(outState:
PacMap):
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any}): AbilityConstant.OnSaveResult;
](
../reference/apis/js-apis-app
lication-a
bility.md#abilityonsavestate
)
|
| onRestoreAbilityState?(inState:
PacMap):
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onCreate(want: Want, param: AbilityConstant.LaunchParam): void;
](
../reference/apis/js-apis-app
lication-a
bility.md#abilityoncreate
)
<br/>
应用重启后会触发Ability的onCreate方法,通过判断launchParam.launchReason可获取自恢复的场景,从而可以从Want中获取重启前保存的数据 |
| onInactive?():
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onBackground(): void;
](
../reference/apis/js-apis-app
lication-a
bility.md#abilityonbackground
)
|
| onActive?():
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onForeground(): void;
](
../reference/apis/js-apis-app
lication-a
bility.md#abilityonforeground
)
|
| onNewWant?(want:
Want):
void; |
\@
ohos.app.ability.UIAbility.d.ts |
[
onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void;
](
../reference/apis/js-apis-app
lication-a
bility.md#abilityonnewwant
)
|
| onMemoryLevel?(level:
number):
void |
\@
ohos.app.ability.UIAbility.d.ts |
[
onMemoryLevel(level: AbilityConstant.MemoryLevel): void;
](
../reference/apis/js-apis-app
lication-a
bility.md#abilityonmemorylevel
)
|
zh-cn/application-dev/application-models/resourcemanager-switch.md
浏览文件 @
51aabc9c
...
...
@@ -3,4 +3,4 @@
| FA模型接口 | Stage模型接口对应d.ts文件 | Stage模型对应字段 |
| -------- | -------- | -------- |
|
[
getResourceManager(callback: AsyncCallback<ResourceManager>): void;
](
../reference/apis/js-apis-resource-manager.md#resourcemanagergetresourcemanager
)
<br/>
[
getResourceManager(bundleName: string, callback: AsyncCallback<ResourceManager>): void;
](
../reference/apis/js-apis-resource-manager.md#resourcemanagergetresourcemanager-1
)
<br/>
[
getResourceManager(): Promise<ResourceManager>;
](
../reference/apis/js-apis-resource-manager.md#resourcemanagergetresourcemanager-2
)
<br/>
[
getResourceManager(bundleName: string): Promise<ResourceManager>;
](
../reference/apis/js-apis-resource-manager.md#resourcemanagergetresourcemanager-3
)
| application
\C
ontext.d.ts |
[
resourceManager: resmgr.ResourceManager;
](
../reference/apis/js-apis-
inner-
application-context.md#属性
)
|
|
[
getResourceManager(callback: AsyncCallback<ResourceManager>): void;
](
../reference/apis/js-apis-resource-manager.md#resourcemanagergetresourcemanager
)
<br/>
[
getResourceManager(bundleName: string, callback: AsyncCallback<ResourceManager>): void;
](
../reference/apis/js-apis-resource-manager.md#resourcemanagergetresourcemanager-1
)
<br/>
[
getResourceManager(): Promise<ResourceManager>;
](
../reference/apis/js-apis-resource-manager.md#resourcemanagergetresourcemanager-2
)
<br/>
[
getResourceManager(bundleName: string): Promise<ResourceManager>;
](
../reference/apis/js-apis-resource-manager.md#resourcemanagergetresourcemanager-3
)
| application
\C
ontext.d.ts |
[
resourceManager: resmgr.ResourceManager;
](
../reference/apis/js-apis-application-context.md#属性
)
|
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录