Timer for on/off Android support

Dear Ziellos,

Thank you. At this time not any error messages. However I ignored the empty species between variables. :laughing:

Good idea. But how abt Whatsapp, Telegram, Signal, …

It should only stop when there was no background task launched first, like these messengers have.

Maybe it can stopped partially, so that background tasks can still listening on message-ports.

If you are using situations you can use the this command to stop android support:
dbus-send --system --dest=com.jolla.apk
d --type=method_call /com/jolla/apkd com.jolla.apkd.controlService
boolean:false

1 Like

Hello Anig!
Yes, then can be started with
defaultuser ALL = NOPASSWD: /usr/bin/dbus-send

I have made something wrong with systemctl, it does not work. However same with earlier d-bus as you teached me. Irritating if something near to succeed in, but it has something wrong with my action.

The previous Schturman batch worked very excellent way in my previous Jolla, Jolla C and Xperia X . And perhaps in XA2, but now interested in to apply in 10 II,

Thus:
The order:
sudo systemctl start / or stop aliendalvik.service works well in terminal, as it should be.
But when I set the order in Situations app as order, it does not work at all.
Same it with this dbus-order, too.

Succeeded in at last long!
Found also this Allow airplane mode in Situations app under Sailfish OS 3 – mascha.me

Then your all helping advices!

Thank you all for help!

I’ve found this to be a great idea as I often fall asleep listening to something via YouTube Vanced, which sometimes out of nowhere tends to give very high CPU load and drain battery.

So I made a very simple app that has a slider to select timeout in minutes and then a singleshot QTimer which on timeout makes the following call via DBus:

QDBusMessage mm = QDBusMessage::createMethodCall("com.jolla.apkd",
                                                    "/com/jolla/apkd",
                                                    "com.jolla.apkd",
                                                    "controlService");
mm << false;

QDBusConnection::systemBus().call(mm);

It works perfectly fine, but only if I disable sandboxing in .desktop file using

 Sandboxing=Disabled

Does anyone know what to do (e.g. which permissions to use, or whatever else needs to be done) to make it work with sandboxing enabled?

Does sandboxing somehow block systemBus DBus calls? Does it take some specific permission to allow them? In my other applications DBus calls via sessionBus work just fine with sandboxing enabled, but this systemBus call just has no effect unless I disable sandboxing.