mirror of
https://gitee.com/openharmony/applications_screenlock
synced 2024-11-22 22:09:53 +00:00
修改p7b添加系统权限
Signed-off-by: chenlang <18577333310@163.com>
This commit is contained in:
parent
28375b0764
commit
24bfb120a5
@ -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<String>) {
|
||||
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');
|
||||
}
|
||||
|
@ -78,6 +78,9 @@
|
||||
},
|
||||
{
|
||||
"name": "ohos.permission.CONNECT_IME_ABILITY"
|
||||
},
|
||||
{
|
||||
"name": "ohos.permission.ACCESS_SCREEN_LOCK_INNER"
|
||||
}
|
||||
],
|
||||
"extensionAbilities": [
|
||||
|
@ -72,6 +72,12 @@
|
||||
},
|
||||
{
|
||||
"name": "ohos.permission.SET_WALLPAPER"
|
||||
},
|
||||
{
|
||||
"name": "ohos.permission.CONNECT_IME_ABILITY"
|
||||
},
|
||||
{
|
||||
"name": "ohos.permission.ACCESS_SCREEN_LOCK_INNER"
|
||||
}
|
||||
],
|
||||
"extensionAbilities": [
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user