修改p7b添加系统权限

Signed-off-by: chenlang <18577333310@163.com>
This commit is contained in:
chenlang 2023-03-29 17:27:58 +08:00
parent 28375b0764
commit 24bfb120a5
4 changed files with 18 additions and 7 deletions

View File

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

View File

@ -78,6 +78,9 @@
},
{
"name": "ohos.permission.CONNECT_IME_ABILITY"
},
{
"name": "ohos.permission.ACCESS_SCREEN_LOCK_INNER"
}
],
"extensionAbilities": [

View File

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