diff --git a/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/ServiceAbility/service.ts index c9c458edc6d7a338554c1a8af704ceb4063e9c2a..1ce8cbf6964abd152681c3c420c6726e9903fbaf 100644 --- a/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/ServiceAbility/service.ts +++ b/ability/ability_runtime/actsserviceabilityclienttest/actsserviceabilityserverrelyhap/entry/src/main/ets/ServiceAbility/service.ts @@ -48,6 +48,16 @@ class StubTest extends rpc.RemoteObject { console.log('ACTS_SerivceAbilityServer ====< method called.') } } + +function sleep(delay) { + let start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } +} + export default { onStart(want) { console.debug('ACTS_SerivceAbilityServer 0425 ====>onStart .ts 0851 =' @@ -78,6 +88,7 @@ export default { }, } ); + sleep(600) particleAbility.terminateSelf().then((data) => { console.log('ACTS_SerivceAbilityServer terminateSelf data:' + JSON.stringify(data)); }).catch((error) => { @@ -201,4 +212,4 @@ export default { ); commonEvent.publish("ACTS_SerivceAbilityServer_OnAbilityConnectDone", (err) => { }); }, -}; \ No newline at end of file +};