Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6f340675
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
6f340675
编写于
6月 30, 2023
作者:
O
openharmony_ci
提交者:
Gitee
6月 30, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9136 xts接口属性覆盖
Merge pull request !9136 from kirl75/master
上级
a8f0ccd6
d79e578d
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
187 addition
and
2 deletion
+187
-2
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/Application/AbilityStage.ts
...verhaptest/entry/src/main/ets/Application/AbilityStage.ts
+31
-1
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/FormAbility/FormAbility.ts
...overhaptest/entry/src/main/ets/FormAbility/FormAbility.ts
+19
-0
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/MainAbility/MainAbility.ts
...overhaptest/entry/src/main/ets/MainAbility/MainAbility.ts
+4
-0
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/SecondAbility/SecondAbility.ts
...haptest/entry/src/main/ets/SecondAbility/SecondAbility.ts
+1
-0
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/ThirdAbility/SecondAbility.ts
...rhaptest/entry/src/main/ets/ThirdAbility/SecondAbility.ts
+67
-0
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/ThirdAbility/pages/MainAbility_pages.ets
...try/src/main/ets/ThirdAbility/pages/MainAbility_pages.ets
+36
-0
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
...rhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
+15
-0
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/NewApiCoverAbility.test.ets
...ptest/entry/src/main/ets/test/NewApiCoverAbility.test.ets
+1
-0
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/module.json
...ntime/apicover/apicoverhaptest/entry/src/main/module.json
+11
-0
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+2
-1
未找到文件。
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/Application/AbilityStage.ts
浏览文件 @
6f340675
...
...
@@ -14,10 +14,40 @@
*/
import
AbilityStage
from
"
@ohos.app.ability.AbilityStage
"
const
ONACCEPTWANT_KEY_NOTSET_ID
=
-
1
;
const
ONACCEPTWANT_KEY_UNDEFINED_ID
=
-
2
;
var
onAcceptWantCalledSeq
;
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[Demo] MyAbilityStage onCreate
"
)
globalThis
.
stageContext
=
this
.
context
;
}
onAcceptWant
(
want
)
{
console
.
log
(
"
AbilityMultiInstanceAppA onAcceptWant called want:
"
+
JSON
.
stringify
(
want
));
if
((
want
.
parameters
==
undefined
)
||
(
want
.
parameters
.
startId
==
undefined
))
{
console
.
log
(
"
AbilityMultiInstanceAppA specified param err
"
);
return
;
}
var
abilityId
=
want
.
parameters
.
startId
.
toString
();
onAcceptWantCalledSeq
=
"
onAcceptWantCalled
"
;
onAcceptWantCalledSeq
+=
"
Id
"
;
onAcceptWantCalledSeq
+=
abilityId
;
globalThis
.
onAcceptWantCalledSeq
=
onAcceptWantCalledSeq
;
if
(
want
.
parameters
.
startId
==
ONACCEPTWANT_KEY_NOTSET_ID
)
{
return
;
}
else
if
(
want
.
parameters
.
startId
==
ONACCEPTWANT_KEY_UNDEFINED_ID
)
{
return
undefined
;
}
globalThis
.
abilityWant
=
want
;
console
.
log
(
"
AbilityMultiInstanceAppA set globalThis result :
"
+
globalThis
.
onAcceptWantCalledSeq
);
return
abilityId
;
}
onConfigurationUpdate
(
config
)
{
console
.
log
(
'
[Demo] MainAbility onConfigurationUpdate:
'
+
this
.
context
.
config
.
language
)
console
.
log
(
'
[Demo] MainAbility onConfigurationUpdate:
'
+
config
.
language
)
globalThis
.
UpdateConfiguration_0200
=
config
.
language
}
}
\ No newline at end of file
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/FormAbility/FormAbility.ts
浏览文件 @
6f340675
...
...
@@ -43,21 +43,35 @@ export default class FormAbility extends FormExtension {
onCastToNormalForm
(
formId
)
{
// Called when the form provider is notified that a temporary form is successfully
// converted to a normal form.
console
.
info
(
"
FormAbility onCastToNormalForm===end===
"
+
formId
)
}
onUpdateForm
(
formId
)
{
console
.
info
(
"
FormAbility onUpdateForm===end===
"
+
formId
)
// Called to notify the form provider to update a specified form.
let
formData
=
{};
let
proxies
=
[
{
"
key
"
:
"
detail
"
,
"
subscriberId
"
:
"
11
"
}
]
let
formBinding
=
formBindingData
.
createFormBindingData
(
formData
);
formBinding
[
"
proxies
"
]
=
proxies
;
}
onChangeFormVisibility
(
newStatus
)
{
console
.
info
(
"
FormAbility onChangeFormVisibility===end===
"
+
newStatus
)
// Called when the form provider receives form events from the system.
}
onFormEvent
(
formId
,
message
)
{
console
.
info
(
"
FormAbility onFormEvent===end===
"
+
message
)
// Called when a specified message event defined by the form provider is triggered.
}
onRemoveForm
(
formId
)
{
console
.
info
(
"
FormAbility onRemoveForm===end===
"
+
formId
)
// Called to notify the form provider that a specified form has been destroyed.
}
...
...
@@ -66,4 +80,9 @@ export default class FormAbility extends FormExtension {
console
.
info
(
"
FormAbility want success
"
+
JSON
.
stringify
(
want
.
parameters
))
return
formInfo
.
FormState
.
READY
;
}
onConfigurationUpdate
(
config
)
{
console
.
log
(
'
[Demo] MainAbility onConfigurationUpdate:
'
+
this
.
context
.
config
.
language
)
console
.
log
(
'
[Demo] MainAbility onConfigurationUpdate:
'
+
config
.
language
)
}
};
\ No newline at end of file
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/MainAbility/MainAbility.ts
浏览文件 @
6f340675
...
...
@@ -33,6 +33,10 @@ export default class MainAbility extends Ability {
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/MainAbility_pages
"
,
null
)
}
onWindowStageRestore
(
windowStage
){
console
.
log
(
"
[Demo] MainAbility onWindowStageRestore
"
)
}
onWindowStageDestroy
()
{
// Main window is destroyed, release UI related resources
console
.
log
(
"
[Demo] MainAbility onWindowStageDestroy
"
)
...
...
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/SecondAbility/SecondAbility.ts
浏览文件 @
6f340675
...
...
@@ -20,6 +20,7 @@ export default class SecondAbility extends Ability {
console
.
log
(
"
[Demo] SecondAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
applicationContext
=
this
.
context
.
getApplicationContext
();
globalThis
.
SecondLaunchParm
=
launchParam
;
}
onDestroy
()
{
...
...
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/ThirdAbility/SecondAbility.ts
0 → 100644
浏览文件 @
6f340675
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
Ability
from
'
@ohos.app.ability.UIAbility
'
import
commonEvent
from
'
@ohos.commonEvent
'
;
import
wantConstant
from
'
@ohos.app.ability.wantConstant
'
export
default
class
SecondAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
"
[Demo] SecondAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
applicationContext
=
this
.
context
.
getApplicationContext
();
}
onDestroy
()
{
console
.
log
(
"
[Demo] SecondAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] SecondAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
;
windowStage
.
setUIContent
(
this
.
context
,
"
ThirdAbility/pages/MainAbility_pages
"
,
null
)
}
onWindowStageDestroy
()
{
// Main window is destroyed, release UI related resources
console
.
log
(
"
[Demo] SecondAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
[Demo] SecondAbility onForeground
"
)
var
CommonEventPublishData
=
{
parameters
:
{
"
Life
"
:
"
onForeground
"
}
}
commonEvent
.
publish
(
"
Form_StartAbility
"
,
CommonEventPublishData
,
(
err
)
=>
{
console
.
info
(
"
Form_StartAbility onCreate
"
);
});
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
[Demo] SecondAbility onBackground
"
)
}
onDump
(
Param
){
return
null
;
}
onShare
(
wantParam
){
wantParam
[
wantConstant
.
Params
.
CONTENT_TITLE_KEY
]
=
{
title
:
"
baidu
"
},
wantParam
[
wantConstant
.
Params
.
SHARE_ABSTRACT_KEY
]
=
{
Abstract
:
"
share data
"
},
wantParam
[
wantConstant
.
Params
.
SHARE_URL_KEY
]
=
{
uri
:
"
www.baidu.com
"
}
}
};
\ No newline at end of file
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/ThirdAbility/pages/MainAbility_pages.ets
0 → 100644
浏览文件 @
6f340675
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@ohos.router';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../test/List.test'
@Entry
@Component
struct Index {
@State message: string = 'ThirdAbility'
@State create: string = 'ThirdAbility'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
浏览文件 @
6f340675
...
...
@@ -25,6 +25,7 @@ import ability from '@ohos.ability.ability';
import
abilityDelegatorRegistry
from
'@ohos.app.ability.abilityDelegatorRegistry'
;
import
common
from
'@ohos.app.ability.common'
;
import
contextConstant
from
"@ohos.app.ability.contextConstant"
import
wantConstant
from
"@ohos.app.ability.wantConstant"
let
EXTENSION_INFO_ERR
=
16000001
;
let
INNER_ERROR
=
16000050
;
...
...
@@ -472,6 +473,10 @@ export default function ApiCoverTest() {
expect
(
"ohos.extra.param.key.form_identity"
)
.
assertEqual
(
formInfoNew
.
FormParam
.
IDENTITY_KEY
)
expect
(
"ohos.extra.param.key.bundle_name"
)
.
assertEqual
(
formInfoNew
.
FormParam
.
BUNDLE_NAME_KEY
)
expect
(
"ohos.extra.param.key.ability_name"
)
.
assertEqual
(
formInfoNew
.
FormParam
.
ABILITY_NAME_KEY
)
expect
(
'ohos.extra.param.key.form_customize'
)
.
assertEqual
(
formInfoNew
.
FormParam
.
PARAM_FORM_CUSTOMIZE_KEY
)
expect
(
'ohos.extra.param.key.form_launch_reason'
)
.
assertEqual
(
formInfoNew
.
FormParam
.
LAUNCH_REASON_KEY
)
expect
(
1
)
.
assertEqual
(
formInfoNew
.
LaunchReason
.
FORM_DEFAULT
);
expect
(
2
)
.
assertEqual
(
formInfoNew
.
LaunchReason
.
FORM_SHARE
);
expect
(
0
)
.
assertEqual
(
formInfoNew
.
FormState
.
DEFAULT
)
expect
(
1
)
.
assertEqual
(
formInfoNew
.
FormState
.
READY
)
expect
(
-
1
)
.
assertEqual
(
formInfoNew
.
FormState
.
UNKNOWN
)
...
...
@@ -507,9 +512,19 @@ export default function ApiCoverTest() {
expect
(
1
)
.
assertEqual
(
abilityConstant
.
LaunchReason
.
START_ABILITY
)
expect
(
1
)
.
assertEqual
(
abilityConstant
.
LastExitReason
.
ABILITY_NOT_RESPONDING
)
expect
(
2
)
.
assertEqual
(
abilityConstant
.
LastExitReason
.
NORMAL
)
expect
(
3
)
.
assertEqual
(
abilityConstant
.
LastExitReason
.
CPP_CRASH
)
expect
(
4
)
.
assertEqual
(
abilityConstant
.
LastExitReason
.
JS_ERROR
)
expect
(
5
)
.
assertEqual
(
abilityConstant
.
LastExitReason
.
APP_FREEZE
)
expect
(
6
)
.
assertEqual
(
abilityConstant
.
LastExitReason
.
PERFORMANCE_CONTROL
)
expect
(
7
)
.
assertEqual
(
abilityConstant
.
LastExitReason
.
RESOURCE_CONTROL
)
expect
(
8
)
.
assertEqual
(
abilityConstant
.
LastExitReason
.
UPGRADE
)
expect
(
0
)
.
assertEqual
(
abilityConstant
.
MemoryLevel
.
MEMORY_LEVEL_MODERATE
)
expect
(
1
)
.
assertEqual
(
abilityConstant
.
MemoryLevel
.
MEMORY_LEVEL_LOW
)
expect
(
2
)
.
assertEqual
(
abilityConstant
.
MemoryLevel
.
MEMORY_LEVEL_CRITICAL
)
expect
(
5
)
.
assertEqual
(
abilityConstant
.
LaunchReason
.
SHARE
)
expect
(
'ohos.extra.param.key.contentTitle'
)
.
assertEqual
(
wantConstant
.
Params
.
CONTENT_TITLE_KEY
)
expect
(
'ohos.extra.param.key.shareAbstract'
)
.
assertEqual
(
wantConstant
.
Params
.
SHARE_ABSTRACT_KEY
)
expect
(
'ohos.extra.param.key.shareUrl'
)
.
assertEqual
(
wantConstant
.
Params
.
SHARE_URL_KEY
)
done
()
});
...
...
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/NewApiCoverAbility.test.ets
浏览文件 @
6f340675
...
...
@@ -187,6 +187,7 @@ export default function ApiCoverTest() {
}).finally(() => {
globalThis.UpdateConfiguration_0200_resolve = null;
globalThis.UpdateConfiguration_0200_reject = null;
expect(globalThis.UpdateConfiguration_0200).assertEqual('zh-Hans')
console.info("SUB_AA_UpdateConfiguration_0200 ----> set promise to null after all");
done();
});
...
...
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/module.json
浏览文件 @
6f340675
...
...
@@ -46,6 +46,17 @@
"visible"
:
true
,
"launchType"
:
"singleton"
},
{
"name"
:
"ThirdAbility"
,
"srcEntrance"
:
"./ets/ThirdAbility/SecondAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"startWindowIcon"
:
"$media:icon"
,
"startWindowBackground"
:
"$color:white"
,
"visible"
:
true
,
"launchType"
:
"specified"
},
{
"name"
:
"CreateFormAbility"
,
"srcEntrance"
:
"./ets/CreateFormAbility/CreateFormAbility.ts"
,
...
...
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/resources/base/profile/main_pages.json
浏览文件 @
6f340675
...
...
@@ -3,6 +3,7 @@
"MainAbility/pages/MainAbility_pages"
,
"SecondAbility/pages/MainAbility_pages"
,
"CreateFormAbility/pages/MainAbility_pages"
,
"FormHostAbility/pages/MainAbility_pages"
"FormHostAbility/pages/MainAbility_pages"
,
"ThirdAbility/pages/MainAbility_pages"
]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录