Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6c3ca987
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看板
提交
6c3ca987
编写于
8月 08, 2023
作者:
X
xinking129
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix code check
Signed-off-by:
N
xinking129
<
xinxin13@huawei.com
>
上级
b02c7e67
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
49 addition
and
53 deletion
+49
-53
ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts
...ely/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts
+1
-5
ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/actionextensionability/ActsActionExtensionAbility.ts
.../ets/actionextensionability/ActsActionExtensionAbility.ts
+8
-8
ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/entryability/EntryAbility.ts
...otherrely/entry/src/main/ets/entryability/EntryAbility.ts
+2
-2
ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts
...elf/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts
+23
-23
ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/actionextensionability/ActsActionExtensionAbility.ts
.../ets/actionextensionability/ActsActionExtensionAbility.ts
+7
-7
ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/actionextensionability/FeatureActionExtensionAbility.ts
...s/actionextensionability/FeatureActionExtensionAbility.ts
+1
-1
ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/featureability/FeatureAbility.ts
...elf/feature/src/main/ets/featureability/FeatureAbility.ts
+1
-1
ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+6
-6
未找到文件。
ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts
浏览文件 @
6c3ca987
...
@@ -13,19 +13,15 @@
...
@@ -13,19 +13,15 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
ActionExtensionAbility
from
'
@ohos.app.ability.ActionExtensionAbility
'
;
import
ActionExtensionAbility
from
'
@ohos.app.ability.ActionExtensionAbility
'
;
import
wantConstant
from
'
@ohos.app.ability.wantConstant
'
;
import
commonEvent
from
'
@ohos.commonEventManager
'
;
import
hilog
from
'
@ohos.hilog
'
;
export
default
class
UiExtAbility
extends
ActionExtensionAbility
{
export
default
class
UiExtAbility
extends
ActionExtensionAbility
{
onCreate
()
{
onCreate
()
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
UIExtAbility onCreate want: %{public}s
'
);
console
.
info
(
'
=======>UIExtAbility onCreate======>
'
);
console
.
info
(
'
=======>UIExtAbility onCreate======>
'
);
}
}
onSessionCreate
(
want
,
session
)
{
onSessionCreate
(
want
,
session
)
{
console
.
log
(
`want:
${
JSON
.
stringify
(
want
)}
}`
);
console
.
log
(
`want:
${
JSON
.
stringify
(
want
)}
}`
);
var
storage
:
LocalStorage
=
new
LocalStorage
({
let
storage
:
LocalStorage
=
new
LocalStorage
({
'
session
'
:
session
'
session
'
:
session
});
});
session
.
loadContent
(
'
pages/Page
'
,
storage
);
session
.
loadContent
(
'
pages/Page
'
,
storage
);
...
...
ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/actionextensionability/ActsActionExtensionAbility.ts
浏览文件 @
6c3ca987
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
import
ActionExtensionAbility
from
'
@ohos.app.ability.ActionExtensionAbility
'
;
import
ActionExtensionAbility
from
'
@ohos.app.ability.ActionExtensionAbility
'
;
import
commonEventManager
from
'
@ohos.commonEventManager
'
;
import
commonEventManager
from
'
@ohos.commonEventManager
'
;
var
count
=
0
;
let
count
=
0
;
const
TIME_OUT
=
500
;
const
TIME_OUT
=
500
;
export
default
class
ActsActionExtensionAbility
extends
ActionExtensionAbility
{
export
default
class
ActsActionExtensionAbility
extends
ActionExtensionAbility
{
storage
:
LocalStorage
;
storage
:
LocalStorage
;
...
@@ -28,18 +28,18 @@ export default class ActsActionExtensionAbility extends ActionExtensionAbility {
...
@@ -28,18 +28,18 @@ export default class ActsActionExtensionAbility extends ActionExtensionAbility {
onForeground
()
{
onForeground
()
{
console
.
log
(
'
====>ActsActionExtensionAbility onForeground called
'
);
console
.
log
(
'
====>ActsActionExtensionAbility onForeground called
'
);
count
++
;
count
++
;
var
options
=
{
let
options
=
{
parameters
:
{
parameters
:
{
'
count
'
:
count
'
count
'
:
count
}
}
}
}
;
commonEventManager
.
publish
(
'
ACTS_TEST_FOREGROUND
'
,
options
,
function
(){});
commonEventManager
.
publish
(
'
ACTS_TEST_FOREGROUND
'
,
options
,
function
()
{});
}
}
onBackground
()
{
onBackground
()
{
console
.
log
(
'
====>ActsActionExtensionAbility onBackground called
'
);
console
.
log
(
'
====>ActsActionExtensionAbility onBackground called
'
);
count
++
;
count
++
;
commonEventManager
.
publish
(
'
ACTS_TEST_BACKGROUND
'
,
function
(){});
commonEventManager
.
publish
(
'
ACTS_TEST_BACKGROUND
'
,
function
()
{});
setTimeout
(()
=>
{
setTimeout
(()
=>
{
globalThis
.
session
.
terminateSelf
();
globalThis
.
session
.
terminateSelf
();
},
TIME_OUT
);
},
TIME_OUT
);
...
@@ -61,12 +61,12 @@ export default class ActsActionExtensionAbility extends ActionExtensionAbility {
...
@@ -61,12 +61,12 @@ export default class ActsActionExtensionAbility extends ActionExtensionAbility {
onDestroy
()
{
onDestroy
()
{
console
.
log
(
'
====>ActsActionExtensionAbility onDestroy called
'
);
console
.
log
(
'
====>ActsActionExtensionAbility onDestroy called
'
);
count
++
;
count
++
;
var
options
=
{
let
options
=
{
parameters
:
{
parameters
:
{
'
count
'
:
count
'
count
'
:
count
}
}
}
}
;
commonEventManager
.
publish
(
'
ACTS_TEST_DESTROY
'
,
options
,
function
(){});
commonEventManager
.
publish
(
'
ACTS_TEST_DESTROY
'
,
options
,
function
()
{});
}
}
onSessionDestroy
(
session
)
{
onSessionDestroy
(
session
)
{
...
...
ability/ability_runtime/actsactionextensionability/actsactionextensionabilityotherrely/entry/src/main/ets/entryability/EntryAbility.ts
浏览文件 @
6c3ca987
...
@@ -29,8 +29,8 @@ export default class EntryAbility extends UIAbility {
...
@@ -29,8 +29,8 @@ export default class EntryAbility extends UIAbility {
'
ability.want.params.uiExtensionType
'
:
'
action
'
'
ability.want.params.uiExtensionType
'
:
'
action
'
}
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
info
(
'
====>ActionExtensionAbility_0100 err:
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
====>ActionExtensionAbility_0100 err:
'
+
JSON
.
stringify
(
err
));
})
})
;
}
}
if
(
want
.
action
===
'
AsyncCallback_0200
'
)
{
if
(
want
.
action
===
'
AsyncCallback_0200
'
)
{
...
...
ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts
浏览文件 @
6c3ca987
...
@@ -25,7 +25,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -25,7 +25,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
onSessionCreate
(
want
,
session
)
{
onSessionCreate
(
want
,
session
)
{
console
.
log
(
`want:
${
JSON
.
stringify
(
want
)}
}`
);
console
.
log
(
`want:
${
JSON
.
stringify
(
want
)}
}`
);
var
storage
:
LocalStorage
=
new
LocalStorage
({
let
storage
:
LocalStorage
=
new
LocalStorage
({
'
session
'
:
session
'
session
'
:
session
});
});
session
.
loadContent
(
'
pages/Page
'
,
storage
);
session
.
loadContent
(
'
pages/Page
'
,
storage
);
...
@@ -42,7 +42,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -42,7 +42,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
}
}
},
(
error
)
=>
{
},
(
error
)
=>
{
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1000 error.code ======>
'
+
error
.
code
);
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1000 error.code ======>
'
+
error
.
code
);
var
commonEventData
=
{
let
commonEventData
=
{
parameters
:
{
parameters
:
{
num
:
error
.
code
num
:
error
.
code
}
}
...
@@ -64,7 +64,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -64,7 +64,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
}
}
}).
then
(()
=>
{
}).
then
(()
=>
{
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1100 UIExtAbility startAbility success ======>
'
);
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1100 UIExtAbility startAbility success ======>
'
);
var
commonEventData
=
{
let
commonEventData
=
{
parameters
:
{
parameters
:
{
str
:
'
success
'
str
:
'
success
'
}
}
...
@@ -74,7 +74,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -74,7 +74,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
});
});
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
debug
(
'
====>Acts_ActionExtensionAbility_1100 UIExtAbility startAbility err:
'
+
JSON
.
stringify
(
err
));
console
.
debug
(
'
====>Acts_ActionExtensionAbility_1100 UIExtAbility startAbility err:
'
+
JSON
.
stringify
(
err
));
})
})
;
}
}
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_1200
'
)
{
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_1200
'
)
{
...
@@ -88,7 +88,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -88,7 +88,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
}
}
},
(
error
)
=>
{
},
(
error
)
=>
{
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1200 error.code ======>
'
+
error
.
code
);
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1200 error.code ======>
'
+
error
.
code
);
var
commonEventData
=
{
let
commonEventData
=
{
parameters
:
{
parameters
:
{
num
:
error
.
code
num
:
error
.
code
}
}
...
@@ -112,7 +112,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -112,7 +112,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1300 error.code ======>
'
+
error
.
code
);
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1300 error.code ======>
'
+
error
.
code
);
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1300 data.resultCode ======>
'
+
data
.
resultCode
);
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1300 data.resultCode ======>
'
+
data
.
resultCode
);
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1300 data.action ======>
'
+
data
.
want
.
parameters
.
action
);
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1300 data.action ======>
'
+
data
.
want
.
parameters
.
action
);
var
commonEventData
=
{
let
commonEventData
=
{
parameters
:
{
parameters
:
{
num
:
error
.
code
,
num
:
error
.
code
,
str
:
data
.
want
.
parameters
.
action
,
str
:
data
.
want
.
parameters
.
action
,
...
@@ -137,7 +137,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -137,7 +137,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
}).
then
((
data
)
=>
{
}).
then
((
data
)
=>
{
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1400 data.resultCode ======>
'
+
data
.
resultCode
);
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1400 data.resultCode ======>
'
+
data
.
resultCode
);
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1400 data.action ======>
'
+
data
.
want
.
parameters
.
action
);
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1400 data.action ======>
'
+
data
.
want
.
parameters
.
action
);
var
commonEventData
=
{
let
commonEventData
=
{
parameters
:
{
parameters
:
{
str
:
data
.
want
.
parameters
.
action
,
str
:
data
.
want
.
parameters
.
action
,
result
:
data
.
resultCode
result
:
data
.
resultCode
...
@@ -162,7 +162,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -162,7 +162,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
}
}
},
(
error
,
data
)
=>
{
},
(
error
,
data
)
=>
{
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1500 first from own error.code ======>
'
+
error
.
code
);
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1500 first from own error.code ======>
'
+
error
.
code
);
var
commonEventData
=
{
let
commonEventData
=
{
parameters
:
{
parameters
:
{
num
:
error
.
code
num
:
error
.
code
}
}
...
@@ -179,7 +179,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -179,7 +179,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
parameters
:
{
parameters
:
{
'
result
'
:
data
'
result
'
:
data
}
}
}
}
;
commonEvent
.
publish
(
'
setReceiveDataCallback
'
,
options
,
(
err
)
=>
{
commonEvent
.
publish
(
'
setReceiveDataCallback
'
,
options
,
(
err
)
=>
{
console
.
log
(
'
Acts_ActionExtensionAbility_1600
'
);
console
.
log
(
'
Acts_ActionExtensionAbility_1600
'
);
});
});
...
@@ -194,7 +194,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -194,7 +194,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
abilityName
:
'
ActsActionExtensionAbility
'
abilityName
:
'
ActsActionExtensionAbility
'
},
(
error
,
data
)
=>
{
},
(
error
,
data
)
=>
{
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1800 first from own error.code ======>
'
+
error
.
code
);
console
.
info
(
'
=======>Acts_ActionExtensionAbility_1800 first from own error.code ======>
'
+
error
.
code
);
var
commonEventData
=
{
let
commonEventData
=
{
parameters
:
{
parameters
:
{
num
:
error
.
code
num
:
error
.
code
}
}
...
@@ -210,7 +210,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -210,7 +210,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
parameters
:
{
parameters
:
{
'
context
'
:
this
.
context
'
context
'
:
this
.
context
}
}
}
}
;
commonEvent
.
publish
(
'
ACTS_TEST_CONTEXT
'
,
options
,
(
err
)
=>
{
commonEvent
.
publish
(
'
ACTS_TEST_CONTEXT
'
,
options
,
(
err
)
=>
{
console
.
log
(
'
Acts_ActionExtensionAbility_context
'
);
console
.
log
(
'
Acts_ActionExtensionAbility_context
'
);
});
});
...
@@ -330,24 +330,24 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -330,24 +330,24 @@ export default class UiExtAbility extends ActionExtensionAbility {
}
}
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_3000
'
)
{
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_3000
'
)
{
var
moduleContext
=
this
.
context
.
createModuleContext
(
'
entry
'
);
let
moduleContext
=
this
.
context
.
createModuleContext
(
'
entry
'
);
let
options
=
{
let
options
=
{
parameters
:
{
parameters
:
{
'
bundleName
'
:
moduleContext
.
applicationInfo
.
name
'
bundleName
'
:
moduleContext
.
applicationInfo
.
name
}
}
}
}
;
commonEvent
.
publish
(
'
ACTS_TEST_CONTEXT
'
,
options
,
(
err
)
=>
{
commonEvent
.
publish
(
'
ACTS_TEST_CONTEXT
'
,
options
,
(
err
)
=>
{
console
.
log
(
'
Acts_ActionExtensionAbility_context
'
);
console
.
log
(
'
Acts_ActionExtensionAbility_context
'
);
});
});
}
}
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_3100
'
)
{
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_3100
'
)
{
var
moduleContext
=
this
.
context
.
createModuleContext
(
'
entry_test
'
);
let
moduleContext
=
this
.
context
.
createModuleContext
(
'
entry_test
'
);
let
options
=
{
let
options
=
{
parameters
:
{
parameters
:
{
'
bundleName
'
:
moduleContext
.
applicationInfo
.
name
'
bundleName
'
:
moduleContext
.
applicationInfo
.
name
}
}
}
}
;
commonEvent
.
publish
(
'
ACTS_TEST_CONTEXT
'
,
options
,
(
err
)
=>
{
commonEvent
.
publish
(
'
ACTS_TEST_CONTEXT
'
,
options
,
(
err
)
=>
{
console
.
log
(
'
Acts_ActionExtensionAbility_context
'
);
console
.
log
(
'
Acts_ActionExtensionAbility_context
'
);
});
});
...
@@ -355,7 +355,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -355,7 +355,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_3200
'
)
{
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_3200
'
)
{
try
{
try
{
var
moduleContext
=
this
.
context
.
createModuleContext
(
'
entry_assist
'
);
let
moduleContext
=
this
.
context
.
createModuleContext
(
'
entry_assist
'
);
}
catch
{
}
catch
{
console
.
log
(
'
createModuleContext err
'
);
console
.
log
(
'
createModuleContext err
'
);
}
}
...
@@ -363,7 +363,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -363,7 +363,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
parameters
:
{
parameters
:
{
'
moduleContext
'
:
moduleContext
'
moduleContext
'
:
moduleContext
}
}
}
}
;
commonEvent
.
publish
(
'
ACTS_TEST_CONTEXT
'
,
options
,
(
err
)
=>
{
commonEvent
.
publish
(
'
ACTS_TEST_CONTEXT
'
,
options
,
(
err
)
=>
{
console
.
log
(
'
Acts_ActionExtensionAbility_context
'
);
console
.
log
(
'
Acts_ActionExtensionAbility_context
'
);
});
});
...
@@ -371,7 +371,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -371,7 +371,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_3300
'
)
{
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_3300
'
)
{
try
{
try
{
var
moduleContext
=
this
.
context
.
createModuleContext
(
'
abc
'
);
let
moduleContext
=
this
.
context
.
createModuleContext
(
'
abc
'
);
}
catch
{
}
catch
{
console
.
log
(
'
createModuleContext err
'
);
console
.
log
(
'
createModuleContext err
'
);
}
}
...
@@ -379,7 +379,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -379,7 +379,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
parameters
:
{
parameters
:
{
'
moduleContext
'
:
moduleContext
'
moduleContext
'
:
moduleContext
}
}
}
}
;
commonEvent
.
publish
(
'
ACTS_TEST_CONTEXT
'
,
options
,
(
err
)
=>
{
commonEvent
.
publish
(
'
ACTS_TEST_CONTEXT
'
,
options
,
(
err
)
=>
{
console
.
log
(
'
Acts_ActionExtensionAbility_context
'
);
console
.
log
(
'
Acts_ActionExtensionAbility_context
'
);
});
});
...
@@ -387,7 +387,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -387,7 +387,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_3400
'
)
{
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_3400
'
)
{
try
{
try
{
var
moduleContext
=
this
.
context
.
createModuleContext
(
undefined
);
let
moduleContext
=
this
.
context
.
createModuleContext
(
undefined
);
}
catch
{
}
catch
{
console
.
log
(
'
createModuleContext err
'
);
console
.
log
(
'
createModuleContext err
'
);
}
}
...
@@ -395,19 +395,19 @@ export default class UiExtAbility extends ActionExtensionAbility {
...
@@ -395,19 +395,19 @@ export default class UiExtAbility extends ActionExtensionAbility {
parameters
:
{
parameters
:
{
'
moduleContext
'
:
moduleContext
'
moduleContext
'
:
moduleContext
}
}
}
}
;
commonEvent
.
publish
(
'
ACTS_TEST_CONTEXT
'
,
options
,
(
err
)
=>
{
commonEvent
.
publish
(
'
ACTS_TEST_CONTEXT
'
,
options
,
(
err
)
=>
{
console
.
log
(
'
Acts_ActionExtensionAbility_context
'
);
console
.
log
(
'
Acts_ActionExtensionAbility_context
'
);
});
});
}
}
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_3500
'
)
{
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_3500
'
)
{
var
applicationContext
=
this
.
context
.
getApplicationContext
();
let
applicationContext
=
this
.
context
.
getApplicationContext
();
let
options
=
{
let
options
=
{
parameters
:
{
parameters
:
{
'
applicationContext
'
:
applicationContext
'
applicationContext
'
:
applicationContext
}
}
}
}
;
commonEvent
.
publish
(
'
ACTS_TEST_CONTEXT
'
,
options
,
(
err
)
=>
{
commonEvent
.
publish
(
'
ACTS_TEST_CONTEXT
'
,
options
,
(
err
)
=>
{
console
.
log
(
'
Acts_ActionExtensionAbility_context
'
);
console
.
log
(
'
Acts_ActionExtensionAbility_context
'
);
});
});
...
...
ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/entry/src/main/ets/actionextensionability/ActsActionExtensionAbility.ts
浏览文件 @
6c3ca987
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
import
ActionExtensionAbility
from
'
@ohos.app.ability.ActionExtensionAbility
'
;
import
ActionExtensionAbility
from
'
@ohos.app.ability.ActionExtensionAbility
'
;
import
commonEventManager
from
'
@ohos.commonEventManager
'
;
import
commonEventManager
from
'
@ohos.commonEventManager
'
;
var
count
=
0
;
let
count
=
0
;
const
TIME_OUT
=
500
;
const
TIME_OUT
=
500
;
export
default
class
ActsActionExtensionAbility
extends
ActionExtensionAbility
{
export
default
class
ActsActionExtensionAbility
extends
ActionExtensionAbility
{
storage
:
LocalStorage
;
storage
:
LocalStorage
;
...
@@ -32,14 +32,14 @@ export default class ActsActionExtensionAbility extends ActionExtensionAbility {
...
@@ -32,14 +32,14 @@ export default class ActsActionExtensionAbility extends ActionExtensionAbility {
parameters
:
{
parameters
:
{
'
count
'
:
count
'
count
'
:
count
}
}
}
}
;
commonEventManager
.
publish
(
'
ACTS_TEST_FOREGROUND
'
,
options
,
function
(){});
commonEventManager
.
publish
(
'
ACTS_TEST_FOREGROUND
'
,
options
,
function
()
{});
}
}
onBackground
()
{
onBackground
()
{
console
.
log
(
'
====>ActsActionExtensionAbility onBackground called
'
);
console
.
log
(
'
====>ActsActionExtensionAbility onBackground called
'
);
count
++
;
count
++
;
commonEventManager
.
publish
(
'
ACTS_TEST_BACKGROUND
'
,
function
(){});
commonEventManager
.
publish
(
'
ACTS_TEST_BACKGROUND
'
,
function
()
{});
setTimeout
(()
=>
{
setTimeout
(()
=>
{
globalThis
.
session
.
terminateSelf
();
globalThis
.
session
.
terminateSelf
();
},
TIME_OUT
);
},
TIME_OUT
);
...
@@ -61,12 +61,12 @@ export default class ActsActionExtensionAbility extends ActionExtensionAbility {
...
@@ -61,12 +61,12 @@ export default class ActsActionExtensionAbility extends ActionExtensionAbility {
onDestroy
()
{
onDestroy
()
{
console
.
log
(
'
====>ActsActionExtensionAbility onDestroy called
'
);
console
.
log
(
'
====>ActsActionExtensionAbility onDestroy called
'
);
count
++
;
count
++
;
var
options
=
{
let
options
=
{
parameters
:
{
parameters
:
{
'
count
'
:
count
'
count
'
:
count
}
}
}
}
;
commonEventManager
.
publish
(
'
ACTS_TEST_DESTROY
'
,
options
,
function
(){});
commonEventManager
.
publish
(
'
ACTS_TEST_DESTROY
'
,
options
,
function
()
{});
}
}
onSessionDestroy
(
session
)
{
onSessionDestroy
(
session
)
{
...
...
ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/actionextensionability/FeatureActionExtensionAbility.ts
浏览文件 @
6c3ca987
...
@@ -31,7 +31,7 @@ export default class FeatureActionExtensionAbility extends ActionExtensionAbilit
...
@@ -31,7 +31,7 @@ export default class FeatureActionExtensionAbility extends ActionExtensionAbilit
onSessionCreate
(
want
,
session
)
{
onSessionCreate
(
want
,
session
)
{
console
.
log
(
'
====>FeatureActionExtensionAbility onSessionCreate called
'
);
console
.
log
(
'
====>FeatureActionExtensionAbility onSessionCreate called
'
);
commonEventManager
.
publish
(
'
ACTS_FEATURE_CREATE
'
,
function
(){});
commonEventManager
.
publish
(
'
ACTS_FEATURE_CREATE
'
,
function
()
{});
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_0400
'
)
{
if
(
want
.
action
===
'
Acts_ActionExtensionAbility_0400
'
)
{
this
.
context
.
startAbility
({
this
.
context
.
startAbility
({
bundleName
:
'
com.example.actsactionextensionabilitytest
'
,
bundleName
:
'
com.example.actsactionextensionabilitytest
'
,
...
...
ability/ability_runtime/actsactionextensionability/actsactionextensionabilityself/feature/src/main/ets/featureability/FeatureAbility.ts
浏览文件 @
6c3ca987
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
*/
*/
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
import
hilog
from
'
@ohos.hilog
'
;
import
hilog
from
'
@ohos.hilog
'
;
import
window
from
'
@ohos.window
'
;
import
type
window
from
'
@ohos.window
'
;
export
default
class
FeatureAbility
extends
UIAbility
{
export
default
class
FeatureAbility
extends
UIAbility
{
onCreate
(
want
,
launchParam
)
{
onCreate
(
want
,
launchParam
)
{
...
...
ability/ability_runtime/actsactionextensionability/actsactionextensionabilitytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
浏览文件 @
6c3ca987
...
@@ -16,8 +16,8 @@ import hilog from '@ohos.hilog';
...
@@ -16,8 +16,8 @@ import hilog from '@ohos.hilog';
import
TestRunner
from
'
@ohos.application.testRunner
'
;
import
TestRunner
from
'
@ohos.application.testRunner
'
;
import
AbilityDelegatorRegistry
from
'
@ohos.app.ability.abilityDelegatorRegistry
'
;
import
AbilityDelegatorRegistry
from
'
@ohos.app.ability.abilityDelegatorRegistry
'
;
var
abilityDelegator
=
undefined
;
let
abilityDelegator
=
undefined
;
var
abilityDelegatorArguments
=
undefined
;
let
abilityDelegatorArguments
=
undefined
;
async
function
onAbilityCreateCallback
()
{
async
function
onAbilityCreateCallback
()
{
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
onAbilityCreateCallback
'
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
onAbilityCreateCallback
'
);
...
@@ -39,14 +39,14 @@ export default class OpenHarmonyTestRunner implements TestRunner {
...
@@ -39,14 +39,14 @@ export default class OpenHarmonyTestRunner implements TestRunner {
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun run
'
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun run
'
);
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
();
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
();
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.TestAbility
'
;
let
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.TestAbility
'
;
var
lMonitor
=
{
let
lMonitor
=
{
abilityName
:
testAbilityName
,
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
);
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
);
var
cmd
=
'
aa start -d 0 -a TestAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
;
let
cmd
=
'
aa start -d 0 -a TestAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
;
var
debug
=
abilityDelegatorArguments
.
parameters
[
'
-D
'
];
let
debug
=
abilityDelegatorArguments
.
parameters
[
'
-D
'
];
if
(
debug
==
'
true
'
)
{
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
;
cmd
+=
'
-D
'
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录