fix_memory_level_call

Signed-off-by: chenzhuo <chenzhuo84@huawei.com>
This commit is contained in:
chenzhuo 2024-10-12 16:03:55 +08:00
parent 69adf9cbb7
commit 0105f1bbbc
4 changed files with 19 additions and 0 deletions

View File

@ -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))
}
}

View File

@ -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

View File

@ -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))
}
}

View File

@ -80,6 +80,10 @@ class ServiceExtAbility extends ServiceExtension {
sTimeManager.release()
}
onMemoryLevel(level): void {
Log.showInfo(TAG, 'onMemoryLevel, level:' + JSON.stringify(level))
}
}
export default ServiceExtAbility