Nemo.KeepAlive goes to sleep

HARDWARE: Xperia 10 II


Import statement Nemo KeepAlive 1.2 not functioning, app still goes to sleep.


Apps are built using as the EA update cocked everything up.

Make or use an app that requires Nemo.KeepAlive and watch it go noddy-blinkums


Ermm, as above.


My app to have insomnia…stay awake/stay on/staying alive …uh. uh, uh, uh, staying alive, staying alive


App goes ZZZzzZZZZzzZZZzzzZZZzzzzZZzz


piercings, tattoos…just kidding, no, no mods to me or my device, just plain vanilla sfos.


I have other apps using KeepAlive, they are also affected, they do not stay awake unless the charger is plugged in.

Could you please provide the source code to your app? Preferably so that all the “extra” is stripped, and only the bare minimum to demonstrate the incorrect behavior left in place?

Will do @vige

I need to reorder my code, like you say, strip it back to only what’s needed. I will do this later today, meanwhile, while the weather is fine, I need to tackle my overgrowing garden!

I’ve got a simple QML-only app (for my own use) using KeepAlive, basically a very simple timer to turn off Android support after selected period of time (number of minutes) and then close itself, too.

Other than having to update the service and iface details of the DBus call (which changed in 4.5.x.x from com.jolla.apkd to com.jolla.apkd.control), the code continues to work OK on 4.5.x.x without any further changes, at least with timer values <=80 minutes as I haven’t used any longer values since the OS update. Maybe later today I’ll test it with 120 minutes to make sure that it doesn’t fall asleep after longer periods.

EDIT: After 120 minutes the timer - as expected - turned off Android support and shut down the application.

So Nemo.KeepAlive 1.2 definitely does work correctly. Well, at least on my 10 III and XA2U, both with

1 Like

Hi @vige, rather than strip back an existing app, i made a new simple app called color-recall. I added Nemo.KeepAlive 1.2 and as expected, the app does not stay awake.

Notably, in Settings/Display, I have changed “Sleep after: X” to different options, from 15 seconds to 1 minute" and my app seems to comply with these settings despite Nemo.KeepAlive being set.

My device is an Xperia 10 II, software version: while the SDK is still using I did upgrade to SDK (EA) but the entire installation was unusable, so I reinstalled back to SDK.

The code, short and simple;

import QtQuick 2.0
import Sailfish.Silica 1.0
import Nemo.KeepAlive 1.2
import Nemo.Configuration 1.0

Page {

    allowedOrientations: Orientation.All

    DisplayBlanking { preventBlanking: true } // 'I forgot to add this line, doh!!'

    backgroundColor: "black"

    Rectangle {
        id: rect
        anchors.centerIn: parent; width: 500; height: width
        color: "#ff0000"; radius: 50; border { width: 4; color: "white" }

        ConfigurationGroup { id: settings; path: "/apps/harbour-color-recall" }
        Component.onDestruction: { settings.setValue("rectColor", rect.color); console.log(rect.color) }
        Component.onCompleted: { rect.color = settings.value("rectColor", "#ff0000"); console.log(rect.color) }

        MouseArea { anchors.fill: parent; onClicked: { rect.color = Qt.rgba(Math.random(),Math.random(),Math.random(),1); console.log(rect.color) }}

It took 7 attempts to build this, due to FAILED TO DEPLOY RPM messages in console…this is ongoing. <— this deserves a separate post!! :frowning:

Where is your DisplayBlanking {} or KeepAlive{} object?

1 Like

Thankyou! @attah - you are correct here sir for sure!!, however, looking back at a different app which still falls asleep, I notice I have added DisplayBlanking { preventBlanking: true }.

But yes, I have missed it here, so I’ll add it to the app and try again, I’m not convinced (yet) that this is the problem.

You’ll probably need to set preventBlanking or enabled booleans respectively.
See docs: Nemo QML Plugins Keepalive - Sailfish OS

1 Like

I have correctly used KeepAlive in one of my dashboard apps, but that still goes to sleep, not sure why, it never used to but it does now. Thanks for the info and your input :slight_smile:

Seems I need to take a break and try again another time.

@vige, it seems I’ve made a real school by error as pointed out by @attah. I will come back to this.

@vige; okay, thanks to input from @attah, I’ve realised I’ve made a few mistakes and surely it does not help to NOT add DisplayBlanking { preventBlanking: true }.

The one app that keeps going to sleep is also my fault. I have 3 pages in this particular app, I had forgotten that I had set my app to show SecondPage.qml upon which I had NOT set DisplayBlanking. Now it’s added, the app is staying awake!

Problem solved, now to work on myself!..

I’m a wally!!!!