Easer icon indicating copy to clipboard operation
Easer copied to clipboard

Manual refresh required for scripts to be processed

Open cast-away opened this issue 7 years ago • 21 comments

Hiya, With my current setup on Android 8 (details below) I need to click on the refresh button on the outline page for the scripts to be triggered. Am I missing something? profiles:

  • wifi on
  • wifi off

event:

  • cell location (home)

scripts:

  1. arrive home
  • parent: empty (what would this do incidentally?)
  • profile: wifi on
  • predefined event: home
  • repeatable when satisfied + persistent
  1. leave home
  • parent: empty
  • profile: wifi off
  • predefined event: home (reverse scenario)
  • repeatable when satisfied + persistent

cast-away avatar Sep 03 '18 09:09 cast-away

Hi there, I'm not sure which Script (Profile actually) is triggered when you press the refresh button, but I have a guess:

Since you are using Event, it will only fire when the event actually happens. (Use Condition for a "state".) For cell location, you need to leave your home (cell tower), and re-enter to see the change.

renyuneyun avatar Sep 04 '18 17:09 renyuneyun

Hiya, Thanks for looking into this. Both scripts are correctly triggered when pressing the refreshing button but do nothing on their own. I have changed them to use Conditions instead with the exact same result. Last time I gave it an hour after I arrived home, wifi was still off and turned on instantly after a manual refresh.

cast-away avatar Sep 09 '18 19:09 cast-away

That seems strange... Though your initial set of "persistent" should be changed to "volatile" (but this doesn't matter as you have changed to Condition). After all, the change of cell tower is based solely on the information provided by Android, and should immediately be caught by Easer.

Is this the only problem you encountered in Easer? Does other Events or Conditions work?

I'll think about this more... In the meantime, do you mind sharing your scripts&events&conditions&profiles? You can do this by using the "export" function provided in the settings page. Note this contains all your scripts&events&conditions&profiles so remember to remove sensitive information beforehands :P

renyuneyun avatar Sep 13 '18 17:09 renyuneyun

Happened to me too:

  1. Condition (working days) 1.1 Condition (before 6pm) 1.1.1 Event (after 9am) -> moderate sound volume 1.1.2 Condition (after 9am) -> moderate sound volume

Y tried both Event and Condition, both individually and now both together. Still, sometimes I have to open the app and press "Refresh".

racuna avatar Oct 05 '18 14:10 racuna

I'm wondering if the "service" is getting snoozed/dozed somehow?

conceptrat avatar Oct 07 '18 07:10 conceptrat

It just does not work, I have the simplest setup ever. Just a condition with a time, it simply does not do anything until you press the refresh button. Not even if I'm in the app when the condition becomes true it's doing anything. I don't know if it's an Android 8 issue but it's quite depressing.

andyvalerio avatar Oct 18 '18 21:10 andyvalerio

Thanks guys. I think I now know the problem... The Service of loading Profile is not put to foreground (even after I put the other Service to foreground), and it may be killed/snoozed by the system...

Silly me, I'll fix this soon.


No I didn't... This is not the real problem. (Though I fixed this part.)

I forgot the app is compiled with args targeting at before 8.0, so the 8.0 thing should not affect Easer yet.

renyuneyun avatar Oct 20 '18 15:10 renyuneyun

Alright, thanks for investigating it and nice that you found the problem. If you let me know when there is an update I can test it with a couple of different devices.

andyvalerio avatar Oct 20 '18 16:10 andyvalerio

@renyuneyun Was about to try installing your app to test out my theory above. Yep I've never installed it but I'm making comments ;).

The reason I suggested the service getting snoozed is because the other app I've been using for a while now, Tasker, had the same issue way back near it's first release and had an option available to create a notification to keep the app from being put to sleep or killed by the system process. This was usually only necessary for some Android versions. It's possible that this issue has come back in another form in Android 8.

This is all just conjecture, as I'm not a fully competent Android developer yet.

conceptrat avatar Oct 20 '18 21:10 conceptrat

Hi @renyuneyun, thanks for the effort you put into updating the app. Unfortunately this still does not work at all. Even with the app open and in the foreground you are still required to press the update button manually, or to stop and re-start the whole thing from "Outline", for the conditions to be evaluated.

andyvalerio avatar Oct 23 '18 07:10 andyvalerio

Hi @andyvandermeyde , This seems strange, and I can't reproduce on two Android 8.1 devices. (Though, both devices have some strange Android behaviour...) Can you share your setup? e.g. your Condition, Script (and Profile)?

p.s. if what you're encountering is purely for Time Event or Condition, it may have some delay because of Android's way of scheduling (for battery optimization).

renyuneyun avatar Oct 28 '18 23:10 renyuneyun

Hi! To make it even easier I recorded a video: https://youtu.be/JnQz-bHp30U

At the end you can see that I click the update button just to show that the condition actually works, it's just never ever updating. I stopped after a few minutes but I could have left it there for hours and it would never update (I tried to leave it there for up to 24 hours).

andyvalerio avatar Oct 31 '18 17:10 andyvalerio

Hi @andyvandermeyde , Thanks for the video! This clarifies a lot, and it really seem to be a big problem.

Just one more info: does this happen only for Time (Event/Condition)? (Specifically, you could use battery related Event/Condition for a quick test.)

renyuneyun avatar Nov 02 '18 00:11 renyuneyun

Hi @renyuneyun , I think you might be onto something here. I tried the battery charging condition and this one seems to work properly. The problem could really be Time conditions...

andyvalerio avatar Nov 14 '18 18:11 andyvalerio

Hi, Not sure this is limited to Time conditions as I am still struggling with location conditions: now reverse scenario works but not normal... Both have to be manually triggered still. I have not yet found how to clean sensitive information from the log, apologies for this.

cast-away avatar Nov 14 '18 19:11 cast-away

Hi, I have the same problem with reverse condition for wifi connection. The normal conditions works (connecting to a defined wifi sets the correct profile), but leaving a wifi does not fire any event - not even hours later. Pressing refresh sets the correct profile.

chrm-software avatar Jan 08 '19 13:01 chrm-software

I am using Easer to run a script on boot (using status Connection "no connection" or "wireless", i.e. in any case) to

  1. activate Wifi (in case there is no connection),
  2. start Spotify,
  3. increase to maximum media volume over headphones.

For some reason, the last step, i.e. increase to maximum media volume does not work consistently. It works if I manually refresh in the Easer main menu, but it does not work when the script is otherwise executed correctly (i.e. Wifi is activated, Spotify launched) at boot.

I have tried increasing volume to maximum both by using the corresponding Easer action as well as by running command "service call audio 3 i32 3 i32 15" on my rooted Android 7.1.2 device. It seems also like one cannot increase media volume to max in background, but only manually in foreground.

jmb20 avatar May 10 '20 10:05 jmb20

I am using Easer to run a script on boot (using status Connection "no connection" or "wireless", i.e. in any case) to

  1. activate Wifi (in case there is no connection),
  2. start Spotify,
  3. increase to maximum media volume over headphones.

For some reason, the last step, i.e. increase to maximum media volume does not work consistently. It works if I manually refresh in the Easer main menu, but it does not work when the script is otherwise executed correctly (i.e. Wifi is activated, Spotify launched) at boot.

I have tried increasing volume to maximum both by using the corresponding Easer action as well as by running command "service call audio 3 i32 3 i32 15" on my rooted Android 7.1.2 device. It seems also like one cannot increase media volume to max in background, but only manually in foreground.

I don't know anything about this but the first thing that comes to my mind is that some devices (like S8) have a warning message/popup that the user has to confirm manually when they try to set the maximum volume, it's pure speculation but maybe it has something to do with that.

andyvalerio avatar May 10 '20 18:05 andyvalerio

Indeed, this warning message is present when user tries to manually increase volume beyond a certain threshold and must be confirmed OK for volume to be increased beyond. I had hoped the Easer action or the above direct service call would circumvent the nag screen.

Since the volume change is performed when the script is manually triggered in Easer (by way of refresh) I wonder whether one can trigger an Easer script from a home screen icon button press? I don't necessarily need auto execution at boot, but I'd want Wifi connect, volume to max and Spotify launch to be a scripted sequence.

*** Edit ***

It appears this behaviour is indeed triggered by the headphone maximum volume warning. After the below treatment on my Android 7.1.2 phone I am now able to use Easer to increase volume to the max.

To bypass headphone max volume warning, edit build.prop in /system/ of your rooted Android phone and add audio.safemedia.bypass=true

I used ADB to pull build.prop to my system, edited the build.prop, remounted the Android's file system as writeable (using command "adb remount") and used ADB to push the edited build.prop back. Prior to this exercise it is very advisable to create a backup of build.prop with ADB shell cp.

jmb20 avatar May 10 '20 18:05 jmb20

Anyone ever find a resolution to this? I am having the same issue on my OnePlus 6 running LineageOS (no GApps) Android 11

urza9814 avatar Feb 09 '22 17:02 urza9814

I face the same issue. I use a condition to change my volume settings when I reach a specific cell and change it back when I leave the cell. I have to manually refresh in the Easer App, otherwise the rules will not proceed. The installation is fresh via F-Droid.

Easer Version: 0.8.2.3 Permissions allowed: Location, Nearby devices Permissions not allowed: Calendar, Call logs, Files and media, SMS

Device: Xiaomi mi10 Lite 5G (Link to GSM Arena for specifications) OS: MIUI Global 13.0.4.0 Android version: 12 SKQ1.211006.001

Do anyone has any idea how to fix the issue?

L00PN00B avatar Sep 25 '23 19:09 L00PN00B