openharmony_ci e8fa95c6f2 !63 Gitee Review - change_misc_components
Merge pull request !63 from 鲍亚永/change_misc_components
2022-07-22 06:18:44 +00:00
2022-07-20 21:37:53 +08:00
2022-03-09 13:34:43 +08:00
2022-07-20 21:37:53 +08:00
2022-07-20 23:43:43 +08:00
2022-07-20 22:35:49 +08:00
2022-07-20 21:37:53 +08:00
2022-07-20 23:43:43 +08:00
2022-07-20 21:37:53 +08:00
2022-07-20 21:37:53 +08:00
2022-03-09 13:34:43 +08:00
2022-03-09 08:24:15 +00:00
2022-03-16 17:36:32 +08:00
2022-03-09 13:34:43 +08:00
2022-07-20 21:37:53 +08:00

miscservices_screenlock

Introduction

Provide three-party APP with the ability to request unlockScreen, query the screenlock status, and query whether to set the screenlock password. Provide screenOn callback, screenOff callback, screenSaver in and out callback, user switching callback, and screenlock manager service running status callback to the operation management

subsystem architecture diagram

Warehouse path

/base/miscservices/screenlock

Introduction to framework code

/base/miscservices/screenlock ├── figures # architecture diagram ├── frameworks/innerkitsimpl # interface provided for app ├── interfaces # interface code provided by module │ ├── innerkits # inter service interface │ └── kits # napi interface ├── sa_profile # module contains the config files of system services and processes ├── services # implementation of screenlock manager service ├── test # unit test of interface └── utils # module contains log printing and constants for ordered commonEvent

JS APIs and instructions

  1. JS APIs function isScreenLocked(callback: AsyncCallback): void; query the screenlock statuscallback mode function isScreenLocked(): Promise; void; query the screenlock statusPromise mode

function isSecureMode(callback: AsyncCallback): void; query whether to set screenlock password (gesture, digital password, pin, SIM)callback mode function isSecureMode(): Promise; query whether to set screenlock password (gesture, digital password, pin, SIM)Promise mode

function unlockScreen(callback: AsyncCallback): void; request unlockScreencallback mode function unlockScreen(): Promise; request unlockScreenPromise mode

  1. JS APIs instructions // Import module import screenLock from '@ohos.screenLock';

// query the screenlock status asynchronously with a Promise screenLock.isScreenLocked()
.then((value) => {
console.log(success to screenLock.isScreenLocked: ${value});
}).catch((err) => {
console.error(failed to screenLock.isScreenLocked because ${err.message})
});

// query the screenlock status asynchronously with a callback screenLock.isScreenLocked((err, value) => {
if (err) {
console.error(failed to screenLock.isScreenLocked because ${err.message});
return;
}
console.log(success to screenLock.isScreenLocked: ${value});
});

Debugging method

  1. Compile command

./build.sh --product-name (Fill in the specific product name, such asHi3516DV300) --build-target screenlock_native

  1. push so file

in $root\out\ohos-arm-release\miscservices\screenlock_nativepush libscreenlock_server.z.so libscreenlock_client.z.so libscreenlock_utils.z.so to system/liband push libscreenlockability.z.so to system/lib/module/app下.make sure the four so files is readable at least.

  1. reboot

Participation contribution

  1. Fork warehouse
  2. Submission code
  3. Create a new pull request
  4. Commit is complete
S
Description
ScreenLock System Ability | 锁屏服务
Readme 646 KiB
Languages
C++ 99.5%
C 0.5%