How to get the device lock status in an app?

asked 2019-05-12 13:15:08 +0200

jsommer gravatar image

I'm working on a system overlay feature, that must not be shown, if the device is locked and the lock screen is shown. How can I retrieve this status inside my app?

edit retag flag offensive close delete


just choose correct layer for your overlay

coderus ( 2019-05-12 15:59:43 +0200 )edit

@coderus Thanks. I think this is the relevant code snipped:

overlayView = SailfishApp::createView();
QObject::connect(overlayView->engine(), SIGNAL(quit()), qGuiApp, SLOT(quit()));
overlayView->rootContext()->setContextProperty("viewHelper", this);
QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface();
native->setWindowProperty(overlayView->handle(), QLatin1String("CATEGORY"), "notification");

The layer seems to be the notification layer in this case, correct? Can you suggest another one under the lock screen?

jsommer ( 2019-05-18 17:58:26 +0200 )edit