Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
0ff906ad
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看板
提交
0ff906ad
编写于
12月 05, 2022
作者:
Z
zengyawen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
application-models
Signed-off-by:
N
zengyawen
<
zengyawen1@huawei.com
>
上级
0257d54b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
27 addition
and
27 deletion
+27
-27
zh-cn/application-dev/application-models/application-context-stage.md
...ation-dev/application-models/application-context-stage.md
+2
-2
zh-cn/application-dev/application-models/common-event-overview.md
...plication-dev/application-models/common-event-overview.md
+1
-1
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
+19
-19
zh-cn/application-dev/application-models/hop-multi-device-collaboration.md
...-dev/application-models/hop-multi-device-collaboration.md
+2
-2
zh-cn/application-dev/application-models/mission-management-overview.md
...ion-dev/application-models/mission-management-overview.md
+1
-1
zh-cn/application-dev/application-models/request-permissions.md
...application-dev/application-models/request-permissions.md
+1
-1
未找到文件。
zh-cn/application-dev/application-models/application-context-stage.md
浏览文件 @
0ff906ad
...
...
@@ -176,7 +176,7 @@ export default class EntryAbility extends UIAbility {
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 当获取的是其他应用的Context时:
>
> - 申请`ohos.permission.GET_BUNDLE_INFO_PRIVILEGED`权限,配置方式请参阅[访问控制授权申请指导](../security/accesstoken-guidelines.md#stage
%E6%A8%A1%E5%9E%8B
)。
> - 申请`ohos.permission.GET_BUNDLE_INFO_PRIVILEGED`权限,配置方式请参阅[访问控制授权申请指导](../security/accesstoken-guidelines.md#stage
模型
)。
>
> - 接口为系统接口,三方应用不支持调用。
...
...
@@ -199,7 +199,7 @@ export default class EntryAbility extends UIAbility {
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 当获取的是其他应用的指定Module的Context时:
>
> - 申请`ohos.permission.GET_BUNDLE_INFO_PRIVILEGED`权限,配置方式请参阅[访问控制授权申请指导](../security/accesstoken-guidelines.md#stage
%E6%A8%A1%E5%9E%8B
)。
> - 申请`ohos.permission.GET_BUNDLE_INFO_PRIVILEGED`权限,配置方式请参阅[访问控制授权申请指导](../security/accesstoken-guidelines.md#stage
模型
)。
>
> - 接口为系统接口,三方应用不支持调用。
...
...
zh-cn/application-dev/application-models/common-event-overview.md
浏览文件 @
0ff906ad
...
...
@@ -19,7 +19,7 @@ OpenHarmony通过CES(Common Event Service,公共事件服务)为应用程
-
有序公共事件:CES转发公共事件时,按订阅者订阅先后顺序,在接收到前一个订阅者回复后,再转发下一个订阅者。
-
粘性公共事件:能够让订阅者收到在订阅前已经发送的公共事件就是粘性公共事件。普通的公共事件只能在订阅后发送才能收到,而粘性公共事件的特殊性就是可以先发送后订阅。发送粘性事件必须是系统应用或系统服务,且需要申请
`ohos.permission.COMMONEVENT_STICKY`
权限,配置方式请参阅
[
访问控制授权申请指导
](
../security/accesstoken-guidelines.md#stage
%E6%A8%A1%E5%9E%8B
)
。
-
粘性公共事件:能够让订阅者收到在订阅前已经发送的公共事件就是粘性公共事件。普通的公共事件只能在订阅后发送才能收到,而粘性公共事件的特殊性就是可以先发送后订阅。发送粘性事件必须是系统应用或系统服务,且需要申请
`ohos.permission.COMMONEVENT_STICKY`
权限,配置方式请参阅
[
访问控制授权申请指导
](
../security/accesstoken-guidelines.md#stage
模型
)
。
每个应用都可以按需订阅公共事件,订阅成功,当公共事件发布时,系统会将其发送给对应的应用。这些公共事件可能来自系统、其他应用和应用自身。
...
...
zh-cn/application-dev/application-models/common-event-subscription.md
浏览文件 @
0ff906ad
...
...
@@ -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#%E6%9D%83%E9%99%90%E5%88%97%E8%A1%A8
)
。
## 接口说明
...
...
zh-cn/application-dev/application-models/context-switch.md
浏览文件 @
0ff906ad
...
...
@@ -4,25 +4,25 @@
| FA接口 | Stage模型接口对应d.ts文件 | Stage对应接口或字段 |
| -------- | -------- | -------- |
|
[
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-uiAbilityContext.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-uiAbilityContext.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-uiAbilityContext.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
)
|
|
[
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-uiAbilityContext.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-uiAbilityContext.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-uiAbilityContext.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-uiAbilityContext.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-uiAbilityContext.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-uiAbilityContext.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-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-uiAbilityContext.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-uiAbilityContext.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-uiAbilityContext.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/hop-multi-device-collaboration.md
浏览文件 @
0ff906ad
...
...
@@ -47,7 +47,7 @@
### 开发步骤
1.
申请
`ohos.permission.DISTRIBUTED_DATASYNC`
权限,配置方式请参阅
[
访问控制授权申请指导
](
../security/accesstoken-guidelines.md#stage
%E6%A8%A1%E5%9E%8B
)
。
1.
申请
`ohos.permission.DISTRIBUTED_DATASYNC`
权限,配置方式请参阅
[
访问控制授权申请指导
](
../security/accesstoken-guidelines.md#stage
模型
)
。
2.
申请数据同步权限,弹框示例代码。
...
...
@@ -129,7 +129,7 @@
### 开发步骤
1.
申请
`ohos.permission.DISTRIBUTED_DATASYNC`
权限,配置方式请参阅
[
访问控制授权申请指导
](
../security/accesstoken-guidelines.md#stage
%E6%A8%A1%E5%9E%8B
)
。
1.
申请
`ohos.permission.DISTRIBUTED_DATASYNC`
权限,配置方式请参阅
[
访问控制授权申请指导
](
../security/accesstoken-guidelines.md#stage
模型
)
。
2.
申请数据同步权限,弹框示例代码。
...
...
zh-cn/application-dev/application-models/mission-management-overview.md
浏览文件 @
0ff906ad
...
...
@@ -30,7 +30,7 @@
一个UIAbility实例对应一个单独的任务,因此应用调用startAbility()方法启动一个UIAbility时,就是创建了一个任务。
桌面应用调用
[
missionManager
](
../reference/apis/js-apis-missionManager.md
)
的接口管理任务,需要申请
`ohos.permission.MANAGE_MISSIONS`
权限,配置方式请参阅
[
访问控制授权申请指导
](
../security/accesstoken-guidelines.md#stage
%E6%A8%A1%E5%9E%8B
)
。
桌面应用调用
[
missionManager
](
../reference/apis/js-apis-missionManager.md
)
的接口管理任务,需要申请
`ohos.permission.MANAGE_MISSIONS`
权限,配置方式请参阅
[
访问控制授权申请指导
](
../security/accesstoken-guidelines.md#stage
模型
)
。
利用missionManager进行任务管理(监听任务变化、获取任务信息、获取任务快照、清理任务、任务加锁/解锁等),示例代码如下:
...
...
zh-cn/application-dev/application-models/request-permissions.md
浏览文件 @
0ff906ad
...
...
@@ -10,7 +10,7 @@
在config.json声明需要的权限,在module下添加"reqPermissions",并写入对应权限。
如申请访问日历权限,需要申请
`ohos.permission.READ_CALENDAR`
权限,配置方式请参阅
[
访问控制授权申请指导
](
../security/accesstoken-guidelines.md#stage
%E6%A8%A1%E5%9E%8B
)
。
如申请访问日历权限,需要申请
`ohos.permission.READ_CALENDAR`
权限,配置方式请参阅
[
访问控制授权申请指导
](
../security/accesstoken-guidelines.md#stage
模型
)
。
对应config.json文件的示例代码如下所示:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录