From e66050f5e8f9c288cc4b12ea0bbd94978dde102d Mon Sep 17 00:00:00 2001 From: zhangwenbo <1291179520@qq.com> Date: Thu, 4 Sep 2025 16:54:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9brightnessManager-context?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangwenbo <1291179520@qq.com> --- .../src/main/ets/default/brightnessManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/brightnesscomponent/src/main/ets/default/brightnessManager.ts b/features/brightnesscomponent/src/main/ets/default/brightnessManager.ts index ef66d3e8..f19d90c5 100644 --- a/features/brightnesscomponent/src/main/ets/default/brightnessManager.ts +++ b/features/brightnesscomponent/src/main/ets/default/brightnessManager.ts @@ -38,7 +38,7 @@ export class brightnessManager { constructor() { this.uri = Constants.getUriSync(Constants.KEY_BRIGHTNESS_STATUS); Log.showInfo(TAG, 'settings geturi of brightness is ' + Constants.URI_VAR); - this.context = AbilityManager.getContext(AbilityManager.ABILITY_NAME_CONTROL_PANEL); + this.context = AbilityManager.getContext(AbilityManager.getContextName(AbilityManager.ABILITY_NAME_CONTROL_PANEL)); this.init(); } @@ -51,7 +51,7 @@ export class brightnessManager { public createDataShare() { if (this.context == undefined || this.context == null) { Log.showInfo(TAG, `constructor, this.context is null`); - return; + this.context = AbilityManager.getContext(AbilityManager.getContextName(AbilityManager.ABILITY_NAME_CONTROL_PANEL)); } Log.showInfo(TAG, `createDataShare, this.context ${this.context}`); const UPDATE_INTERVAL = 500; -- Gitee