[go: nahoru, domu]

Skip to main content

Reddit and its partners use cookies and similar technologies to provide you with a better experience.

By accepting all cookies, you agree to our use of cookies to deliver and maintain our services and site, improve the quality of Reddit, personalize Reddit content and advertising, and measure the effectiveness of advertising.

By rejecting non-essential cookies, Reddit may still use certain cookies to ensure the proper functionality of our platform.

For more information, please see our Cookie Notice and our Privacy Policy.

Get the Reddit app

Scan this QR code to download the app now
Or check it out in the app stores
r/tasker icon
r/tasker icon
Go to tasker
r/tasker


Members Online

AutoInput Actions v2 gracefully handle button not being available?

I'm a little behind but just discovered the Actions v2 option and so far it seems like a huge improvement over the original version! I used it to set up a new action I wanted to perform (updating Google Play Store apps) and it worked well, however I may have the same issue with that one that I'll describe next that brings me to my question.

I created a task some time ago to allow me to Force Stop Pandora with a single click. I set it up using the original AutoInput Actions, waits, etc. and it usually worked ok but was not super reliable. Since I found out about Actions v2 today I decided to rebuild it using that but I'm running into some issues.

I sometimes click the button I create to run this even if I'm not sure Pandora is running in the background (long story short I don't like having the media controls card in my notification tray when I'm not actively using it). However, with Actions v2 if the app is not already running and the "Force Stop" button is greyed out it will just sit there until the task times out. I lowered the task timeout to 2 seconds and set it to continue on error. I then added a second Actions v2 to back out of the app separately so that it would still close out. However, this was causing errors. So instead I removed the second "back out of app" action and replaced it with a tasker "Go Home" app action. This is working now but still throws an error notification for the Actions v2 timeout.

What can I do to supress this error? I'm also open to other/better ways of doing this, however I'd prefer not to go down the root/Wifi ADB route for simplicity sake.

Edit: link to current task https://taskernet.com/shares/?user=AS35m8kijy5wibbCJnu1sOl6yQx%2FANZz%2BX9YtnsFslsCU4DlRFxa40%2Foa1kDSd9Wk3aCE6wpOxdu2fA%3D&id=Task%3AKill+Pandora

Share
Sort by:
Best
Open comment sort options
u/SearchWorm avatar

This shell command will let you know if Pandora is actually running. (no root needed).

Hope this helps out!

Task: Background

A1: Run Shell [
     Command: dumpsys activity processes | grep -E 'APP.*ProcessRecord\{' | sed -E 's/^.*\{[^:]+:([^:/ ]+).*$/\1/g' | sed 's/^[ ]+|[ ]+$//' | sort | uniq
     Timeout (Seconds): 0
     Store Output In: %background_apps
     Use Global Namespace: On ]

A2: Flash [
     Text: Yes
     Continue Task Immediately: On
     Dismiss On Click: On ]
    If  [ %background_apps ~ *com.pandora.android* ]
u/kgjettaIV avatar

Thanks, I may add that as the first steps so I can check before even running the task.

More replies