Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2c88589e
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看板
提交
2c88589e
编写于
7月 20, 2023
作者:
X
xinking129
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify format 1508
Signed-off-by:
N
xinking129
<
xinxin13@huawei.com
>
上级
87d549e9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
25 addition
and
21 deletion
+25
-21
ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/ets/entryability/EntryAbility.ts
...eOneReply/entry/src/main/ets/entryability/EntryAbility.ts
+15
-11
ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability/EntryAbility.ts
...hreeReply/entry/src/main/ets/entryability/EntryAbility.ts
+4
-4
ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability1/EntryAbility1.ts
...eeReply/entry/src/main/ets/entryability1/EntryAbility1.ts
+2
-2
ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/ets/entryability/EntryAbility.ts
...eTwoReply/entry/src/main/ets/entryability/EntryAbility.ts
+2
-2
ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+2
-2
未找到文件。
ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/ets/entryability/EntryAbility.ts
浏览文件 @
2c88589e
...
@@ -25,28 +25,32 @@ let commonEventData = {
...
@@ -25,28 +25,32 @@ let commonEventData = {
};
};
let
tag
=
'
StateChangeTesttag
'
;
let
tag
=
'
StateChangeTesttag
'
;
let
delayTime
_
500
=
500
;
let
delayTime500
=
500
;
let
delayTime
_
1000
=
1000
;
let
delayTime1000
=
1000
;
let
delayTime
_
2000
=
2000
;
let
delayTime2000
=
2000
;
let
undefineTag
=
-
1
;
let
undefineTag
=
-
1
;
let
defineTag
=
1
;
let
defineTag
=
1
;
let
arrLength
=
4
;
let
arrLength
=
4
;
let
onForeGroundTAG
=
undefineTag
;
let
onForeGroundTAG
=
undefineTag
;
let
zero
=
0
;
let
one
=
1
;
let
two
=
2
;
let
three
=
3
;
let
applicationStateChangeCallbackFir
=
{
let
applicationStateChangeCallbackFir
=
{
onApplicationForeground
()
{
onApplicationForeground
()
{
console
.
log
(
tag
,
'
applicationStateChangeCallbackFir onApplicationForeground
'
);
console
.
log
(
tag
,
'
applicationStateChangeCallbackFir onApplicationForeground
'
);
commonEventData
.
parameters
.
commonStateArr
[
0
]
=
defineTag
;
commonEventData
.
parameters
.
commonStateArr
[
zero
]
=
defineTag
;
setTimeout
(()
=>
{
setTimeout
(()
=>
{
console
.
info
(
'
Enter onApplicationForeground publish!
'
);
console
.
info
(
'
Enter onApplicationForeground publish!
'
);
commonEvent
.
publish
(
'
processState
'
,
commonEventData
,
(
err
)
=>
{
commonEvent
.
publish
(
'
processState
'
,
commonEventData
,
(
err
)
=>
{
console
.
info
(
'
====>processState publish err:
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
====>processState publish err:
'
+
JSON
.
stringify
(
err
));
});
});
},
delayTime
_
1000
);
},
delayTime1000
);
},
},
onApplicationBackground
()
{
onApplicationBackground
()
{
console
.
log
(
tag
,
'
applicationStateChangeCallbackFir onApplicationBackground
'
);
console
.
log
(
tag
,
'
applicationStateChangeCallbackFir onApplicationBackground
'
);
commonEventData
.
parameters
.
commonStateArr
[
1
]
=
defineTag
;
commonEventData
.
parameters
.
commonStateArr
[
one
]
=
defineTag
;
if
(
globalThis
.
want
.
action
===
'
NeedBackGroundOff
'
||
globalThis
.
want
.
action
===
'
MultiAppRegister
'
)
{
if
(
globalThis
.
want
.
action
===
'
NeedBackGroundOff
'
||
globalThis
.
want
.
action
===
'
MultiAppRegister
'
)
{
console
.
info
(
'
entered needbackgroundoff!
'
);
console
.
info
(
'
entered needbackgroundoff!
'
);
...
@@ -58,21 +62,21 @@ let applicationStateChangeCallbackFir = {
...
@@ -58,21 +62,21 @@ let applicationStateChangeCallbackFir = {
let
applicationStateChangeCallbackSec
=
{
let
applicationStateChangeCallbackSec
=
{
onApplicationForeground
()
{
onApplicationForeground
()
{
console
.
log
(
tag
,
'
applicationStateChangeCallbackSec onApplicationForeground
'
);
console
.
log
(
tag
,
'
applicationStateChangeCallbackSec onApplicationForeground
'
);
commonEventData
.
parameters
.
commonStateArr
[
2
]
=
defineTag
;
commonEventData
.
parameters
.
commonStateArr
[
two
]
=
defineTag
;
},
},
onApplicationBackground
()
{
onApplicationBackground
()
{
console
.
log
(
tag
,
'
applicationStateChangeCallbackSec onApplicationBackground
'
);
console
.
log
(
tag
,
'
applicationStateChangeCallbackSec onApplicationBackground
'
);
commonEventData
.
parameters
.
commonStateArr
[
3
]
=
defineTag
;
commonEventData
.
parameters
.
commonStateArr
[
three
]
=
defineTag
;
if
(
globalThis
.
want
.
action
===
'
doubleNeedBackGroundOff
'
)
{
if
(
globalThis
.
want
.
action
===
'
doubleNeedBackGroundOff
'
)
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
globalThis
.
applicationContext
.
off
(
'
applicationStateChange
'
,
applicationStateChangeCallbackSec
);
globalThis
.
applicationContext
.
off
(
'
applicationStateChange
'
,
applicationStateChangeCallbackSec
);
},
delayTime
_
500
);
},
delayTime500
);
}
}
else
if
(
globalThis
.
want
.
action
===
'
DoubleRegisterOff
'
)
{
else
if
(
globalThis
.
want
.
action
===
'
DoubleRegisterOff
'
)
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
console
.
info
(
'
entered DoubleRegisterOff
'
);
console
.
info
(
'
entered DoubleRegisterOff
'
);
globalThis
.
applicationContext
.
off
(
'
applicationStateChange
'
);
globalThis
.
applicationContext
.
off
(
'
applicationStateChange
'
);
},
delayTime
_
500
);
},
delayTime500
);
}
}
}
}
};
};
...
@@ -141,7 +145,7 @@ export default class EntryAbility extends Ability {
...
@@ -141,7 +145,7 @@ export default class EntryAbility extends Ability {
commonEvent
.
publish
(
'
processState
'
,
commonEventData
,
(
err
)
=>
{
commonEvent
.
publish
(
'
processState
'
,
commonEventData
,
(
err
)
=>
{
console
.
info
(
'
====>processState publish err:
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
====>processState publish err:
'
+
JSON
.
stringify
(
err
));
});
});
},
delayTime
_
2000
);
},
delayTime2000
);
}
}
}
}
...
...
ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability/EntryAbility.ts
浏览文件 @
2c88589e
...
@@ -20,8 +20,8 @@ import commonEvent from '@ohos.commonEvent';
...
@@ -20,8 +20,8 @@ import commonEvent from '@ohos.commonEvent';
let
tag
=
'
getRunningProcess
'
;
let
tag
=
'
getRunningProcess
'
;
let
commonStateArr
;
let
commonStateArr
;
let
delayTime
_
3000
=
3000
;
let
delayTime3000
=
3000
;
let
delayTime
_
1000
=
1000
;
let
delayTime1000
=
1000
;
let
undefinedTag
=
-
1
;
let
undefinedTag
=
-
1
;
let
definedTag
=
1
;
let
definedTag
=
1
;
let
commonEventData
=
{
let
commonEventData
=
{
...
@@ -41,7 +41,7 @@ let applicationStateChangeCallbackFir = {
...
@@ -41,7 +41,7 @@ let applicationStateChangeCallbackFir = {
commonEvent
.
publish
(
'
processState
'
,
commonEventData
,
(
err
)
=>
{
commonEvent
.
publish
(
'
processState
'
,
commonEventData
,
(
err
)
=>
{
console
.
info
(
'
====>processState publish err:
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
====>processState publish err:
'
+
JSON
.
stringify
(
err
));
});
});
},
delayTime
_
1000
);
},
delayTime1000
);
}
}
};
};
let
foregroundTAG
=
undefinedTag
;
let
foregroundTAG
=
undefinedTag
;
...
@@ -96,7 +96,7 @@ export default class EntryAbility extends Ability {
...
@@ -96,7 +96,7 @@ export default class EntryAbility extends Ability {
commonEvent
.
publish
(
'
processState
'
,
commonEventData
,
(
err
)
=>
{
commonEvent
.
publish
(
'
processState
'
,
commonEventData
,
(
err
)
=>
{
console
.
info
(
'
====>processState publish err:
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
====>processState publish err:
'
+
JSON
.
stringify
(
err
));
});
});
},
delayTime
_
3000
);
},
delayTime3000
);
}
}
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
...
...
ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability1/EntryAbility1.ts
浏览文件 @
2c88589e
...
@@ -16,7 +16,7 @@ import hilog from '@ohos.hilog';
...
@@ -16,7 +16,7 @@ import hilog from '@ohos.hilog';
import
Ability
from
'
@ohos.app.ability.UIAbility
'
;
import
Ability
from
'
@ohos.app.ability.UIAbility
'
;
import
type
Window
from
'
@ohos.window
'
;
import
type
Window
from
'
@ohos.window
'
;
let
delayTime
_
3000
=
3000
;
let
delayTime3000
=
3000
;
export
default
class
EntryAbility1
extends
Ability
{
export
default
class
EntryAbility1
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
onCreate
(
want
,
launchParam
)
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
...
@@ -63,7 +63,7 @@ export default class EntryAbility1 extends Ability {
...
@@ -63,7 +63,7 @@ export default class EntryAbility1 extends Ability {
globalThis
.
abilityContext2
.
terminateSelf
((
err
)
=>
{
globalThis
.
abilityContext2
.
terminateSelf
((
err
)
=>
{
console
.
log
(
'
terminateSelf result:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
terminateSelf result:
'
+
JSON
.
stringify
(
err
));
});
});
},
delayTime
_
3000
);
},
delayTime3000
);
}
}
onBackground
()
{
onBackground
()
{
...
...
ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/ets/entryability/EntryAbility.ts
浏览文件 @
2c88589e
...
@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility';
...
@@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility';
import
type
Window
from
'
@ohos.window
'
;
import
type
Window
from
'
@ohos.window
'
;
let
TAG
=
'
StateChangeTestTAG
'
;
let
TAG
=
'
StateChangeTestTAG
'
;
let
delayTime
_
3000
=
3000
;
let
delayTime3000
=
3000
;
let
applicationStateChangeCallbackSec
=
{
let
applicationStateChangeCallbackSec
=
{
onApplicationForeground
()
{
onApplicationForeground
()
{
console
.
info
(
'
==== ApplicationStateChange Foreground ====
'
);
console
.
info
(
'
==== ApplicationStateChange Foreground ====
'
);
...
@@ -79,7 +79,7 @@ export default class EntryAbility extends Ability {
...
@@ -79,7 +79,7 @@ export default class EntryAbility extends Ability {
globalThis
.
abilityContext
.
terminateSelf
((
err
)
=>
{
globalThis
.
abilityContext
.
terminateSelf
((
err
)
=>
{
console
.
log
(
'
terminateSelf result:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
terminateSelf result:
'
+
JSON
.
stringify
(
err
));
});
});
},
delayTime
_
3000
);
},
delayTime3000
);
}
}
onBackground
()
{
onBackground
()
{
...
...
ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
浏览文件 @
2c88589e
...
@@ -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.application.abilityDelegatorRegistry
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
let
abilityDelegator
=
undefined
let
abilityDelegator
=
undefined
;
let
abilityDelegatorArguments
=
undefined
let
abilityDelegatorArguments
=
undefined
;
function
translateParamsToString
(
parameters
)
{
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
const
keySet
=
new
Set
([
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录