From 0105f1bbbcd1b5eb81c690e1d75ededd37fbd452 Mon Sep 17 00:00:00 2001 From: chenzhuo Date: Sat, 12 Oct 2024 16:03:55 +0800 Subject: [PATCH] fix_memory_level_call Signed-off-by: chenzhuo --- product/pc/src/main/ets/Application/AbilityStage.ts | 4 ++++ .../pc/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts | 4 ++++ product/phone/src/main/ets/Application/AbilityStage.ts | 7 +++++++ .../src/main/ets/ServiceExtAbility/ServiceExtAbility.ts | 4 ++++ 4 files changed, 19 insertions(+) diff --git a/product/pc/src/main/ets/Application/AbilityStage.ts b/product/pc/src/main/ets/Application/AbilityStage.ts index 3b51a28..0c49609 100644 --- a/product/pc/src/main/ets/Application/AbilityStage.ts +++ b/product/pc/src/main/ets/Application/AbilityStage.ts @@ -22,4 +22,8 @@ export default class MainAbilityStage extends AbilityStage { onCreate() { Log.showInfo(TAG, "onCreate") } + + onMemoryLevel(level): void { + Log.showInfo(TAG, 'onMemoryLevel, level:' + JSON.stringify(level)) + } } \ No newline at end of file diff --git a/product/pc/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts b/product/pc/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts index ba9e9f9..c15d953 100644 --- a/product/pc/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts +++ b/product/pc/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts @@ -126,6 +126,10 @@ class ServiceExtAbility extends ServiceExtension { Log.showInfo(TAG, 'api8New onDestroy'); sTimeManager.release() } + + onMemoryLevel(level): void { + Log.showInfo(TAG, 'onMemoryLevel, level:' + JSON.stringify(level)) + } } export default ServiceExtAbility \ No newline at end of file diff --git a/product/phone/src/main/ets/Application/AbilityStage.ts b/product/phone/src/main/ets/Application/AbilityStage.ts index 8638522..5991270 100644 --- a/product/phone/src/main/ets/Application/AbilityStage.ts +++ b/product/phone/src/main/ets/Application/AbilityStage.ts @@ -14,9 +14,16 @@ */ import AbilityStage from "@ohos.app.ability.AbilityStage" +import {Log} from '@ohos/common' + +const TAG = "ScreenLock-MainAbilityStage" export default class MyAbilityStage extends AbilityStage { onCreate() { console.log("[Demo] MyAbilityStage onCreate") } + + onMemoryLevel(level): void { + Log.showInfo(TAG, 'onMemoryLevel, level:' + JSON.stringify(level)) + } } \ No newline at end of file diff --git a/product/phone/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts b/product/phone/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts index 2d65064..ab079fd 100644 --- a/product/phone/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts +++ b/product/phone/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts @@ -80,6 +80,10 @@ class ServiceExtAbility extends ServiceExtension { sTimeManager.release() } + + onMemoryLevel(level): void { + Log.showInfo(TAG, 'onMemoryLevel, level:' + JSON.stringify(level)) + } } export default ServiceExtAbility \ No newline at end of file