renyuneyun / Easer

User-defined explicit automation for Android
https://renyuneyun.github.io/Easer/
GNU General Public License v3.0
815 stars 93 forks source link

Wi-Fi enable/disable doesn't work with flight mode enabled #368

Open just-Nob opened 3 years ago

just-Nob commented 3 years ago

Describe the bug When being at home, I often switch to flight mode, but switch on Wi-Fi afterwards. That makes a lot of sense to save battery with VoWFi enabled, i.e. I am reachable by (mobile) phone. I wanted automatically to switch of Wi-Fi in the night, so I added a simple profile for that, but even if I trigger the profile manually, Wi-Fi still stays active.

To Reproduce Steps to reproduce the behavior:

  1. create new profile
  2. add new action "Wi-Fi"
  3. enable Acton by activating checkbox
  4. set switch to "disable" position
  5. name profile
  6. save profile
  7. enable flight mode at your mobile
  8. enable Wi-Fi at your mobile
  9. activate created Easer profile by long pressing the profile and selecting "activate (?)"
  10. error: Wi-Fi still stays active

(You can also use screencast instead.)

Expected behavior I expected Wi-Fi to switch off when triggered in an Easer profile even with flight mode activated.

Error log: No logfile created.

Extra phone info (please complete the following information):

just-Nob commented 3 years ago

The other way round it's the same: it's also not possible to enable Wi-Fi by a profile with flight mode enabled. I changed the issue's title a little to reflect this.

renyuneyun commented 3 years ago

Thanks for your reporting. I believe this can be linked back to #183 and #54 ?

just-Nob commented 3 years ago

Hi @renyuneyun ,

thanks a lot for your comment. However, I'm sorry to say that I think this issue isn't related to those two referred by you. I guess that my initial description unfortunately wasn't clear enough, so I try a second time, hoping that this time I'm doing better.

Just try this:

  1. Disable both flight mode and wifi on your phone by hand. This could easily be done by using the corresponding tiles located in Android's status bar, for example.
  2. Now trigger Easer to execute any profile enabling wifi, no matter which triggering event or condition is chosen (e.g. a time event or a widget event).
  3. Wifi turns on.

This scenario should work as expected, i.e. as described in "3." (wifi will be enabled). And now do exactly the same, but with flight mode enabled:

  1. Disable wifi but enabje flight mode by hand!
  2. Now trigger Easer one more time to execute any profile enabling wifi.
  3. Wifi should turn on, but it doesn't - it's still deactivated.

Manually, wifi can be enabled even when flight mode is enabled. Unfortunately, Easer isn't capable of doing so.

I also tried to understand why you referenced rhose two issues.

Concerning #183, the only idea I had is that you may think I'm asking for something that isn't implemented yet. But this is not the case, because Easer is able to en-/disable wifi - as long as fight mode is disabled!

Referring to #54, I don't see any sequenced actions in my description - it's only one(!) action to take place, but with pond pre- condition to be fulfilled.

aviladev commented 2 years ago

I have the same issue. Tried to workaround it by creating a predecessor script that disables airplane mode, it works if I just set a timer as the triggering event, however for the real use case, which is to trigger when shutting down (receive broadcast android.intent.action.ACTION_SHUTDOWN), only the predecessor (the one that disables airplane mode) script is run, the second one (that should disable wifi/mobile data) is never run, probably because Android kills the app before it has time to do so.

just-Nob commented 2 years ago

Hi @aviladev, I used Automaton for some weeks (for some reasons), and I had the same problem there. Don't know if this is a general problem or caused by my device. Do you like to check it out on your device as well?