From 09eec1e2088cd9c8b269001236e4d5a7934728ef Mon Sep 17 00:00:00 2001 From: zhangwenbo <1291179520@qq.com> Date: Thu, 4 Sep 2025 16:04:03 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E4=BF=AE=E6=94=B9context=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E5=BC=82=E5=B8=B8--=E5=88=A0=E9=99=A4=20=20s?= =?UTF-8?q?tatic=20getContextName"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit afbbf010418880577b9c0afcfafe7192e1ec3cb7. --- .../src/main/ets/default/brightnessManager.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/features/brightnesscomponent/src/main/ets/default/brightnessManager.ts b/features/brightnesscomponent/src/main/ets/default/brightnessManager.ts index ef66d3e8..6e879ae3 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(); } @@ -49,11 +49,6 @@ export class brightnessManager { } public createDataShare() { - if (this.context == undefined || this.context == null) { - Log.showInfo(TAG, `constructor, this.context is null`); - return; - } - Log.showInfo(TAG, `createDataShare, this.context ${this.context}`); const UPDATE_INTERVAL = 500; const timer = setInterval(() => { dataShare.createDataShareHelper(this.context, this.uri) -- Gitee