Which privileges are required for "Device doze mode set state"

268 views
Skip to first unread message

jot ess

unread,
Apr 20, 2024, 6:06:04 AM4/20/24
to Automate for Android
Hello,
I'm trying to use the "Device doze mode set state" block on a Samsung XCover 4s with Android 11. I have read that "This feature isn’t officially supported, requires Android 6+ and the privileged service, may not work on all devices". Anyway, I want to try it.

I get the exception: com.llamalab.automate.access.AccessNotGrantedException

So what exactly would I have to grant?
I have granted all rights that can be granted from the phone's UI and via ADB I have granted
adb shell pm grant com.llamalab.automate android.permission.CHANGE_CONFIGURATION
and
adb shell pm grant com.llamalab.automate android.permission.WRITE_SECURE_SETTINGS

I believe this should be enough, but the problem persists.
Is there a way to query the successful setting of a privilege?

jot ess

unread,
Apr 20, 2024, 6:12:41 AM4/20/24
to Automate for Android
The aim of my flow is:
My phone has no LED for signalling missed calls. So I want to create a flow that monitors if there is a missed call in if so, it should just switch the display on and off every n seconds. E.g. for 5 seconds every minute or so. I might as well use the device lock/unlock block?
Maybe somepne has an alternative method to achieve my aim that doesn't need the privilege that is missing.

Henrik "The Developer" Lindqvist

unread,
Apr 20, 2024, 6:18:29 AM4/20/24
to Automate for Android
Grant the "privileged or full (superuser) access to device features and storage" privileged.
Setup an "privileged service start method" in Automate settings, e.g. "Android Debug Bridge" if your device isn't rooted.

Henrik "The Developer" Lindqvist

unread,
Apr 20, 2024, 6:19:46 AM4/20/24
to Automate for Android
Use the Device keep awake block to temporarily turn the screen on.

jot ess

unread,
Apr 21, 2024, 1:11:22 PM4/21/24
to Automate for Android
Superuser is one of the privileges I had already granted, so this has obviously not helped (alone).
Where or how could I set up a "privileged service start method" in Automate setting? The only setting I can see inside Automate that has to do with launching is "alternative launch activity". But this doesn't seem like what you mean.
One privilege I have not yet granted is "lock device and monitor unlock activity" because I don't understand the waning message that is displayed if you tap the checkbox. Might this be the hindrance?

jot ess

unread,
Apr 21, 2024, 1:11:49 PM4/21/24
to Automate for Android
This resulted in the same error.

Henrik "The Developer" Lindqvist

unread,
Apr 21, 2024, 1:22:27 PM4/21/24
to Automate for Android
As said, setup an "privileged service start method" in Automate settings (see hamburger menu on flow list screen) under the Privileged & superuser section.

The "lock device and monitor unlock activity" privilege should not be required for the Device doze mode set state block.
Its warning dialog informs users that the app can't be uninstalled while its enabled as such, see: https://llamalab.com/automate/doc/faq.html#uninstall_automate

jot ess

unread,
Apr 21, 2024, 1:56:30 PM4/21/24
to Automate for Android
Thank you, I found it. Not inside Privileges, but on the same level.
This sends me to the device's settings. Here I have to select developer options, I suppose.
Should I go to "Set Debugging App" (or similar, I have to translate back from German "Debugging App festlegen") and set Automate here? I have tried this before, I doesn't work. When I select this, I get the heading "Chose App" ("App auswählen") and in the list I should choose from it just reads "None" ("Keine").
But maybe I'm in the wrong place.

Henrik "The Developer" Lindqvist

unread,
Apr 22, 2024, 12:07:18 PM4/22/24
to Automate for Android
No, that should not necessary. Just enable "Developer setting" to get access to the "Wireless debugging", enable it, then click the "Pair device with pairing" code.
Reply all
Reply to author
Forward
0 new messages