From 2c88589e3f538524a9e58880cef230b563037370 Mon Sep 17 00:00:00 2001 From: xinking129 Date: Thu, 20 Jul 2023 15:13:32 +0800 Subject: [PATCH] modify format 1508 Signed-off-by: xinking129 --- .../src/main/ets/entryability/EntryAbility.ts | 26 +++++++++++-------- .../src/main/ets/entryability/EntryAbility.ts | 8 +++--- .../main/ets/entryability1/EntryAbility1.ts | 4 +-- .../src/main/ets/entryability/EntryAbility.ts | 4 +-- .../ets/TestRunner/OpenHarmonyTestRunner.ts | 4 +-- 5 files changed, 25 insertions(+), 21 deletions(-) diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/ets/entryability/EntryAbility.ts b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/ets/entryability/EntryAbility.ts index d6889a6d3..4e945fe0d 100644 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeOneReply/entry/src/main/ets/entryability/EntryAbility.ts @@ -25,28 +25,32 @@ let commonEventData = { }; let tag = 'StateChangeTesttag'; -let delayTime_500 = 500; -let delayTime_1000 = 1000; -let delayTime_2000 = 2000; +let delayTime500 = 500; +let delayTime1000 = 1000; +let delayTime2000 = 2000; let undefineTag = -1; let defineTag = 1; let arrLength = 4; let onForeGroundTAG = undefineTag; +let zero = 0; +let one = 1; +let two = 2; +let three = 3; let applicationStateChangeCallbackFir = { onApplicationForeground() { console.log(tag, 'applicationStateChangeCallbackFir onApplicationForeground'); - commonEventData.parameters.commonStateArr[0] = defineTag; + commonEventData.parameters.commonStateArr[zero] = defineTag; setTimeout(() => { console.info('Enter onApplicationForeground publish!'); commonEvent.publish('processState', commonEventData, (err) => { console.info('====>processState publish err: ' + JSON.stringify(err)); }); - }, delayTime_1000); + }, delayTime1000); }, 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') { console.info('entered needbackgroundoff!'); @@ -58,21 +62,21 @@ let applicationStateChangeCallbackFir = { let applicationStateChangeCallbackSec = { onApplicationForeground() { console.log(tag, 'applicationStateChangeCallbackSec onApplicationForeground'); - commonEventData.parameters.commonStateArr[2] = defineTag; + commonEventData.parameters.commonStateArr[two] = defineTag; }, onApplicationBackground() { console.log(tag, 'applicationStateChangeCallbackSec onApplicationBackground'); - commonEventData.parameters.commonStateArr[3] = defineTag; + commonEventData.parameters.commonStateArr[three] = defineTag; if (globalThis.want.action === 'doubleNeedBackGroundOff') { setTimeout(() => { globalThis.applicationContext.off('applicationStateChange', applicationStateChangeCallbackSec); - }, delayTime_500); + }, delayTime500); } else if (globalThis.want.action === 'DoubleRegisterOff') { setTimeout(() => { console.info('entered DoubleRegisterOff'); globalThis.applicationContext.off('applicationStateChange'); - }, delayTime_500); + }, delayTime500); } } }; @@ -141,7 +145,7 @@ export default class EntryAbility extends Ability { commonEvent.publish('processState', commonEventData, (err) => { console.info('====>processState publish err: ' + JSON.stringify(err)); }); - }, delayTime_2000); + }, delayTime2000); } } diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability/EntryAbility.ts b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability/EntryAbility.ts index 6ea26fc34..f81b666aa 100644 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability/EntryAbility.ts @@ -20,8 +20,8 @@ import commonEvent from '@ohos.commonEvent'; let tag = 'getRunningProcess'; let commonStateArr; -let delayTime_3000 = 3000; -let delayTime_1000 = 1000; +let delayTime3000 = 3000; +let delayTime1000 = 1000; let undefinedTag = -1; let definedTag = 1; let commonEventData = { @@ -41,7 +41,7 @@ let applicationStateChangeCallbackFir = { commonEvent.publish('processState', commonEventData, (err) => { console.info('====>processState publish err: ' + JSON.stringify(err)); }); - }, delayTime_1000); + }, delayTime1000); } }; let foregroundTAG = undefinedTag; @@ -96,7 +96,7 @@ export default class EntryAbility extends Ability { commonEvent.publish('processState', commonEventData, (err) => { console.info('====>processState publish err: ' + JSON.stringify(err)); }); - }, delayTime_3000); + }, delayTime3000); } hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability1/EntryAbility1.ts b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability1/EntryAbility1.ts index 6d6f86d12..b6f485101 100644 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability1/EntryAbility1.ts +++ b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeThreeReply/entry/src/main/ets/entryability1/EntryAbility1.ts @@ -16,7 +16,7 @@ import hilog from '@ohos.hilog'; import Ability from '@ohos.app.ability.UIAbility'; import type Window from '@ohos.window'; -let delayTime_3000 = 3000; +let delayTime3000 = 3000; export default class EntryAbility1 extends Ability { onCreate(want, launchParam) { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); @@ -63,7 +63,7 @@ export default class EntryAbility1 extends Ability { globalThis.abilityContext2.terminateSelf((err) => { console.log('terminateSelf result:' + JSON.stringify(err)); }); - }, delayTime_3000); + }, delayTime3000); } onBackground() { diff --git a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/ets/entryability/EntryAbility.ts b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/ets/entryability/EntryAbility.ts index 6ca5d5aac..370d2fac3 100644 --- a/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ability/ability_runtime/getrunningprocessinformation/ApplicationStateChangeTwoReply/entry/src/main/ets/entryability/EntryAbility.ts @@ -17,7 +17,7 @@ import Ability from '@ohos.app.ability.UIAbility'; import type Window from '@ohos.window'; let TAG = 'StateChangeTestTAG'; -let delayTime_3000 = 3000; +let delayTime3000 = 3000; let applicationStateChangeCallbackSec = { onApplicationForeground() { console.info('==== ApplicationStateChange Foreground ===='); @@ -79,7 +79,7 @@ export default class EntryAbility extends Ability { globalThis.abilityContext.terminateSelf((err) => { console.log('terminateSelf result:' + JSON.stringify(err)); }); - }, delayTime_3000); + }, delayTime3000); } onBackground() { diff --git a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index 4da8488a0..4dd5c0a05 100644 --- a/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/ability/ability_runtime/getrunningprocessinformation/GetRunningProcessInformationTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -16,8 +16,8 @@ import hilog from '@ohos.hilog'; import TestRunner from '@ohos.application.testRunner' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -let abilityDelegator = undefined -let abilityDelegatorArguments = undefined +let abilityDelegator = undefined; +let abilityDelegatorArguments = undefined; function translateParamsToString(parameters) { const keySet = new Set([ -- GitLab