(Bug) Settings not restoring when profile exits

153 views
Skip to first unread message

Nors233

unread,
Mar 27, 2021, 8:19:43 PM3/27/21
to Tasker
Theres a bug with tasker that settings would not restore if you restart the phone during the active time.

Steps to reproduce:
1. Set a profile with time trigger 10pm - 7am and enable restore settings.
2. Put any task in (I use change wallpaper )
3. Restart the phone anytime while the profile is active .
4. When the profile ends the wallpaper does not change back.

Rich D

unread,
Mar 27, 2021, 10:05:50 PM3/27/21
to Tasker Google Groups Post

Theres a bug with tasker that settings would not restore if you restart the phone during the active time.

That is the expected behavior now.  You had posted about this before 



and the way João fixed the existing bug was to have tasker not do anything when the device shuts down. That can be seen here.




Rich D

unread,
Mar 28, 2021, 9:44:24 AM3/28/21
to Tasker Google Groups Post
I believe the general thinking about the issue is that the profile has not truly gone inactive so why would you need to run a exit task or restore the settings at that point.

However since when the device reboots Tasker will restart all of the enter tasks for enabled profiles, it would seem to make sense that prior to shutdown all settings should be restored.  This way they will be saved through the reboot by Android and everything would start fresh on the reboot.

 So in theory you should end up with the very original settings prior to any activation before the shutdown. 

It would probably be best to raise this issue here,  where João made the determination on how to fix the bug. 

Rich D

unread,
Mar 28, 2021, 10:04:02 AM3/28/21
to Tasker Google Groups Post

However since when the device reboots Tasker will restart all of the enter tasks for enabled profiles

** Correction **

However since when the device reboots Tasker will restart all of the enter tasks for enabled *Active* profiles. 

Nors233

unread,
Mar 28, 2021, 4:54:04 PM3/28/21
to Tasker
For my issue I did not specify an exit task for my profile. When the phone restarts, then Tasker thinks the original wallpaper I had was the one I just changed to. Thus it doesn't restore the original wallpaper (before restart) when the task ends. I have looked into that thread but im not sure if my issue pertains to what Joao said he fixed.

Rich D

unread,
Mar 28, 2021, 6:06:53 PM3/28/21
to Tasker Google Groups Post

For my issue I did not specify an exit task for my profile. When the phone restarts, then Tasker thinks the original wallpaper I had was the one I just changed to. Thus it doesn't restore the original wallpaper (before restart) when the task ends.

Correct. From my tests what is happening is, - Your profile goes active for the first time and changes your wallpaper  from 'A'  to 'B' , when shutdown starts tasker does nothing per the new fix. So it does not run a exit task (wich your profile does not have) "And it does not restore any setting on shutdown"' so the device is shutdown with the same wallpaper 'B' wich android now stores to reapply  at start up . When the device boots tasker will run the enter task again so this is where it gets its new restore point Wallpaper 'B' and sets the wallpaper to 'B'.  Now when it goes inactive the wallpaper is restored to 'B'.

I really have no way of knowing this However I would assume that prior to the 'Fix' Pent had it so the settings were restored at shut down, so they would go back to "A". So then Android would start the device with those restored settings and if the profile did not go active at that point then you would still have your restored "A" settings and if it did go active then the enter task would run and set the settings to 'B'  However it would now have "A" as the restore point. 

That's my story and I'm stikin to it...   :)




Nors233

unread,
Mar 29, 2021, 7:06:41 PM3/29/21
to Tasker
I would be interested to get Joao's input on this. Surely it must be a common issue and I want to know if he can resolve it.

Rich D

unread,
Mar 29, 2021, 10:09:13 PM3/29/21
to Tasker Google Groups Post

I would be interested to get Joao's input on this. Surely it must be a common issue and I want to know if he can resolve it.

That is why I suggested you post on the last link I posted. I would ask him there if the fix could be your issue. I would also put a link to this post for reference. 

Rich D

unread,
Apr 6, 2021, 7:37:54 PM4/6/21
to Tasker Google Groups Post
I finally had a chance to to some more testing on this issue. 
It was a strange issue because I was getting different results from my 2 devices. However I finally figured it out. I did see João's response to your post on the other thread. What he said was spot on with the particular issue you are having. The 'set wallpaper' setting just takes far too long to be able to set it during shut down. You can however get tasker to carry the restore set point through a reboot for simple settings that do not require a lot of time to complete. There is still a strange bug in the shutdown process that for some reason makes this work. First of all you need a profile that has a  Event 'Device Shutdown' context and you need a second profile that has a state variable value context. 
 These profiles will force tasker to restore the settings of any state profile that has that option selected prior to shutdown. 

Here is my test project.  

To run test..

1- Set your display brightness to mid range
2- Enable the 'Set Display Brightness' and tap the check mark to save data.
3- The task will set your display to the lowest setting and your restore point will be the mid range. 
4- Set the display brightness to full.
5- Re-boot device
6- Give the device time to activate the profile. It will set the brightness to the lowest setting.
7. Open tasker and disable the 'Set Display Brightness'  profile.
8. The brightness should be restored to mid range. 




    Profile: Set Display Brightness (1035)
    Time: From  8:01AM Till  7:59AM
    Enter: Set Display Bright (1042)
    A1: Display Brightness [ Level:1 Disable Safeguard:Off Ignore Current Level:Off Immediate Effect:Off ] 
    
    Profile: Value Not Set (1040)
    Restore: no
    State: Variable Value  [ %Never_set !Set ]
    Enter: Var Not Set Enter (1051)
    A1: Notify [ Title:Var Not Set Enter Ran Text:%TIME Icon:null Number:0 Permanent:Off Priority:3 Repeat Alert:Off LED Colour:Red LED Rate:0 Sound File: Vibration Pattern: Category: ] 
    A2: [X] Beep [ Frequency:5368 Duration:1000 Amplitude:50 Stream:3 ] 
    A3: Stop [ With Error:Off Task: ] 
    
    Exit: Var Not Set Exit (1039)
    A1: Notify [ Title:Var Not Set Exit Ran Text:%TIME Icon:null Number:0 Permanent:Off Priority:3 Repeat Alert:Off LED Colour:Red LED Rate:0 Sound File: Vibration Pattern: Category: ] 
    
    Profile: reboot task (929)
    Restore: no
    Event: Device Shutdown
    Enter: reboot task on (930)
    A1: Notify [ Title:Reboot Task Ran Text:%TIME Icon:null Number:0 Permanent:Off Priority:3 Repeat Alert:Off LED Colour:Red LED Rate:0 Sound File: Vibration Pattern: Category: ] 
    

Reply all
Reply to author
Forward
0 new messages