Toggling Bedtime Mode (Wind down) or Reading Mode

Post your questions and help other users.

Moderator: Martin

Post Reply
andirs
Posts: 7
Joined: 05 Aug 2018 17:44

Toggling Bedtime Mode (Wind down) or Reading Mode

Post by andirs » 17 May 2020 07:05

Hey there is it possible to toggle Bedtime Mode or Reading Mode via Automagic?
At least Bedtime Mode is part of Digital Wellbeing. Have not found a way yet, not even with "Set System Settings".

I am on a rooted Lineage OS device running Android 9

Thanks in advance.
Attachments
2020-05-17 09_03_46-.png
2020-05-17 09_03_46-.png (43.34 KiB) Viewed 13294 times

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Toggling Bedtime Mode (Wind down) or Reading Mode

Post by Desmanto » 17 May 2020 18:00

LOS has extra "LineageOS System Setting". But AFAIR, AM 1.37 doesn't work well with LOS 16 above (pie 9.0 above). Try to find the value in the set LineageOS System Setting. It should has less value to find. There is currently no quick way to find it, other than checking the value one by one and guess which one has changed.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

andirs
Posts: 7
Joined: 05 Aug 2018 17:44

Re: Toggling Bedtime Mode (Wind down) or Reading Mode

Post by andirs » 17 May 2020 20:20

Thanks for your reply.
Did a one on one comparison for the LOS settings but nothing changes except for "battery light enabled" which is obvious because it is changed by the bedtime mode function :(

andirs
Posts: 7
Joined: 05 Aug 2018 17:44

Re: Toggling Bedtime Mode (Wind down) or Reading Mode

Post by andirs » 18 May 2020 04:54

The maybe most relevant hint that i found is in the sysui_qs_tiles.
The ones i am looking for are:
1. custom(com.google.android.apps.wellbeing/.screen.ui.GrayscaleTileService)
2. reading_mode

But i am still not finding them anywhere else. Is it possible to toggle tile items via automagic regardless of what they are behind the scenes?
Attachments
Screenshot_20200517-222457_Automagic_Premium.png
Screenshot_20200517-222457_Automagic_Premium.png (157.42 KiB) Viewed 13251 times

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Toggling Bedtime Mode (Wind down) or Reading Mode

Post by Desmanto » 23 May 2020 19:33

I tried to toggle Reading mode in my AEX 6.7 Pie 9.0 ROM, surprisingly it doesn't produce any system setting changed. No logcat available too, no intent catched. This seems to use special API to call the feature directly from the kernel.

sysui_sq_tiles only define the qs tile you add. Try to change the order of your qs tile, you can see the value changed too. It seems no visible way to toggle the value without using Control UI.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

andirs
Posts: 7
Joined: 05 Aug 2018 17:44

Re: Toggling Bedtime Mode (Wind down) or Reading Mode

Post by andirs » 24 May 2020 04:33

Hey Desmanto, thanks fpr your efforts. In the meantime i also found the way using the ui

Execute Root Command: cmd statusbar click-tile com.google.android.apps.wellbeing/.screen.ui.GrayscaleTileService

However i do not really like it because obviously you can only toggle the mode and have no reliable way of finding out if the mode is on or off right now.
Therefore i use a condition to ask if DND is on, but of course this could have also been turned on manually...

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Toggling Bedtime Mode (Wind down) or Reading Mode

Post by Desmanto » 24 May 2020 14:36

Thanks for that cmd command, just know that we have that feature. Unfortunately, it is not working in my ROM. Issuing that root command will cause the SystemUI crash.

In your ROM, since it is working, you can use that. Then save the state using a global variable. It is not the exact solution, but best solution currently. Everytime you enable, save the true state to the glovar; and vice versa. You need to make sure never try to toggle the QS tile outside of automagic flow, as it will reverse the logic state.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply