diff --git a/features/screenlock/src/main/ets/com/ohos/model/screenLockModel.ts b/features/screenlock/src/main/ets/com/ohos/model/screenLockModel.ts index 6028054..40a5096 100644 --- a/features/screenlock/src/main/ets/com/ohos/model/screenLockModel.ts +++ b/features/screenlock/src/main/ets/com/ohos/model/screenLockModel.ts @@ -26,13 +26,15 @@ const TAG = 'ScreenLock-ScreenLockModel'; export default class ScreenLockModel { @SysFaultLogger({FAULT_ID: FaultID.SCREEN_LOCK_MANAGER, MSG: "call func on failed"}) eventListener(callback: Callback) { - let isSuccess = ScreenLockMar.onSystemEvent((err, event)=>{ - Log.showInfo(TAG, `eventListener:callback:${event.eventType}`) - callback(event.eventType); - if (err) { - Log.showError(TAG, `on callback error -> ${JSON.stringify(err)}`); - } - }); + let isSuccess = null + try { + isSuccess = ScreenLockMar.onSystemEvent((event)=>{ + Log.showInfo(TAG, `eventListener:callback:${event.eventType}`) + callback(event.eventType); + }); + } catch (err: any) { + Log.showError(TAG, `on callback error -> ${JSON.stringify(err)}`); + } if (!isSuccess) { callback('serviceRestart'); } diff --git a/product/pc/src/main/module.json5 b/product/pc/src/main/module.json5 index 0a86da8..d4da2ea 100644 --- a/product/pc/src/main/module.json5 +++ b/product/pc/src/main/module.json5 @@ -78,6 +78,9 @@ }, { "name": "ohos.permission.CONNECT_IME_ABILITY" + }, + { + "name": "ohos.permission.ACCESS_SCREEN_LOCK_INNER" } ], "extensionAbilities": [ diff --git a/product/phone/src/main/module.json5 b/product/phone/src/main/module.json5 index 4db82eb..4e5b6b2 100644 --- a/product/phone/src/main/module.json5 +++ b/product/phone/src/main/module.json5 @@ -72,6 +72,12 @@ }, { "name": "ohos.permission.SET_WALLPAPER" + }, + { + "name": "ohos.permission.CONNECT_IME_ABILITY" + }, + { + "name": "ohos.permission.ACCESS_SCREEN_LOCK_INNER" } ], "extensionAbilities": [ diff --git a/signature/systemui.p7b b/signature/systemui.p7b index 624ea05..01a07ce 100644 Binary files a/signature/systemui.p7b and b/signature/systemui.p7b differ