Pixel 4a Android 11 - stop killing/pausing background app ? - Google Pixel 4a Questions & Answers

Hi all,
I have a Pixel 4a with stock Android 11 (up to date, no root, with Nova Launcher).
I have a rowing machine that comes with an app (ErgData, by concept2) that can connect to the machine via bluetooth or via usb cable: while rowing the app logs the workout data (like pace, heart rate etc).
I wanted to do the following: watch a video while the ErgData app logs my workout, so I started ErgData, connected it to the rower, configured the workout and, once ready to start rowing, I switch to the video player and start rowing.
It worked fine a bunch of times, but one day it stopped working: at the end of the workout (like after 20-30min), when I switch back to ErgData the app is in its default screen (like the one you get at startup) and it has logged nothing. When connecting via bluetooth, the app has also lost the connection to the rower. When connecting via usb the connection is there but the app has still logged nothing.
Things I've done:
disable battery optimization for ErgData, Bluetooth and Bluetooth MIDI
disable adaptive battery
use a different media player (android built-in, VLC)
uninstall / reinstall ErgData
clear Bluetooth storage/cache
disabled "Suspend Execution for Cached App" (developer mode)
No joy.
I tried a different app (ErgZone) and it has the same behavior.
I tried staying with ErgZone foreground for 3min before switching to the video player and in that case, ErgZone logged something, but not the totality of the workout.
So it really seems that somehow, when I switch to the video player, ErgData / ErgZone gets "paused" (killed ? cached ?).
Anything I can try ? Anything the app developers should do to prevent this ?
Thanks !

Sorry for the late response, I normally dont browse this forum. I am rooted and always have been, so all the solution I have used in the past are dependent on root. However, one idea to try is checking if the background app is killed while the phone is plugged into a charger? I know that being plugged in keeps the phone awake even when the screen is off.

HornetMaX said:
So it really seems that somehow, when I switch to the video player, ErgData / ErgZone gets "paused" (killed ? cached ?).
Anything I can try ? Anything the app developers should do to prevent this ?
Click to expand...
Click to collapse
Does the ErgData/Zone app start a persistent notification when recording? That's the way to keep a service running in the background. I had a phone with a tendency to kill anything not in the foreground, but it never killed active apps (including background with persistent notification).
If the app dies despite this, there may be a hint in the logcat. You have to enable developer mode to fetch that.

a1291762 said:
Does the ErgData/Zone app start a persistent notification when recording? That's the way to keep a service running in the background. I had a phone with a tendency to kill anything not in the foreground, but it never killed active apps (including background with persistent notification).
If the app dies despite this, there may be a hint in the logcat. You have to enable developer mode to fetch that.
Click to expand...
Click to collapse
No, ErgData/ErgZone do not have a persistent notification. Guess that's a potential solution then.
At the moment my workaround is to use the "pop-up" feature of VLC so that I have the video on top of the other app (ErgData/ErgZone), so that the other app stays foreground. That works, but it's not a real solution.

Hmm they gave me a beta version of the app with the persistent notification thingy and it works perfectly.

Related

Music streaming apps stop after 5 minutes when the phone is locked

So since I Updated to the s8 plus I have not been able to stream my usual local radio app kokefm or online streamimg websites for more than 5 Minutes when the decice is locked. After 5 minutes the stream pauses, and when I unlock the phone the stream resumes. I have checked to make sure background data is enabled for the apps, and no power saving is on. Anyone else having this issue?
I figured out how to fix it if anyone else has this problem.
Go to settings > device maintenance > battery. Then click on battery usage then the three dots on the top right and go to optimize battery usage. There you can change to all apps and turn off optimization for whatever apps are not streaming in the background. Seems kinda redundant since I already had the apps in the not monitored list and allowed background network data... atleast it's working now.
Android 7 has a feature called "Doze" that will make most apps go into a suspended state after the device is idle for a while. This is possibly what's making your music app stop. If your app has a Stay Awake function, you may want to enable it and just turn the screen brightness down instead of off.
I think the problem in settings, that's all... Do you use Spotify? It has become so popular because it gives users what they want. The user can stream music from any Android device. Having over 75 million users, Spotify is the most popular among them. What is the reason behind its popularity and how much does it cost to build an app like Spotify?

Tasker

Having some issues with tasker on the pixel 3. I had the pixel 1 with android pie and had no issues. I migrated my profile and the tasks work if i play them manually but don't seem to work automatically 99% of the time. They also show green as if they should be active. It seems to have something to do with having the screen off. I have battery optimization turned off for the app and I have messed around with a few other settings. Does anyone know the magic combination to get it working? Or any idea what else may be wrong?
Example screnario...I get into my car, bluetooth connects, i wait and pandora doesnt turn on. I unlock the phone and go into tasker, the profile is green as if it is active but Pandora isn't playing. I then open the task and hit the play button and everything works as it should.
I can live without most of my tasks but I really miss Pandora automatically playing and exiting when connected to my bluetooth.
EDIT: My other tasks are hard to verify they aren't working. It seems that they may be working some/most of the time but Pandora has yet to launch while the screen is off. I have smart lock enabled so the phone should unlock when connected to my bluetooth.
huviduc said:
Having some issues with tasker on the pixel 3. I had the pixel 1 with android pie and had no issues. I migrated my profile and the tasks work if i play them manually but don't seem to work automatically 99% of the time. They also show green as if they should be active. It seems to have something to do with having the screen off. I have battery optimization turned off for the app and I have messed around with a few other settings. Does anyone know the magic combination to get it working? Or any idea what else may be wrong?
Example screnario...I get into my car, bluetooth connects, i wait and pandora doesnt turn on. I unlock the phone and go into tasker, the profile is green as if it is active but Pandora isn't playing. I then open the task and hit the play button and everything works as it should.
I can live without most of my tasks but I really miss Pandora automatically playing and exiting when connected to my bluetooth.
EDIT: My other tasks are hard to verify they aren't working. It seems that they may be working some/most of the time but Pandora has yet to launch while the screen is off. I have smart lock enabled so the phone should unlock when connected to my bluetooth.
Click to expand...
Click to collapse
Check to see if accessibility is enabled for Tasker. If memory serves me correctly it needs to be enabled in order to launch an app. I might be wrong about that but it can't hurt to try it. Android settings>accessibility
robocuff said:
Check to see if accessibility is enabled for Tasker. If memory serves me correctly it needs to be enabled in order to launch an app. I might be wrong about that but it can't hurt to try it. Android settings>accessibility
Click to expand...
Click to collapse
I checked and it wasn't enabled. Enabled it but unfortunately the same issue happens. If i have the screen on everything works perfectly fine, screen off nothing happens. I am using always on display if that matters, its the only difference from my pixel 1 setup but I don't see why it would matter.
I also tried clearing all app data, uninstalling, reinstalling and setting up the pandora profile from scratch. Its such a simple task, I don't see why it isn't working. Profile below, selected options in parenthesis.
BT Connected (bluetooth device name) -> Pandora (Launch App Pandora)
Did you select the BT device from the list by tapping the magnifying glass? I have found that if I pair a device the name is the same but the profile won't work until I remove and add it again. Also, some have different modes. For example, my Bose BT headphones pair as "Bose SoundSport" initially, but then connect as "LE Bose SoundSport" after that, so profile trigger has both listed.
Another test I would do is to change the task actions to see if it's actually triggering the profile or if it's an issue with the task. I usually just do Alert > Flash and watch the screen when the profile should be triggering. If the flash works, something isn't working with the launch app action.
Hope this helps.
Edit: I guess I didn't clarify, the task I have with my Bose headphones launches Spotify and starts music (media control > next). It also sets the media volume to a comfortable level. The criteria for this profile is a variable (based on calendar to see if I'm at work or not) and BT connection.
I forgot it was there, but I use Secure Settings to wake the CPU when the task triggers. Not sure if this is still needed or not. I think it was needed at one point to launch with the screen off or something, but I haven't really changed this task for a few years other than updating the BT device name as described above.
fury683 said:
Did you select the BT device from the list by tapping the magnifying glass? I have found that if I pair a device the name is the same but the profile won't work until I remove and add it again. Also, some have different modes. For example, my Bose BT headphones pair as "Bose SoundSport" initially, but then connect as "LE Bose SoundSport" after that, so profile trigger has both listed.
Another test I would do is to change the task actions to see if it's actually triggering the profile or if it's an issue with the task. I usually just do Alert > Flash and watch the screen when the profile should be triggering. If the flash works, something isn't working with the launch app action.
Hope this helps.
Edit: I guess I didn't clarify, the task I have with my Bose headphones launches Spotify and starts music (media control > next). It also sets the media volume to a comfortable level. The criteria for this profile is a variable (based on calendar to see if I'm at work or not) and BT connection.
I forgot it was there, but I use Secure Settings to wake the CPU when the task triggers. Not sure if this is still needed or not. I think it was needed at one point to launch with the screen off or something, but I haven't really changed this task for a few years other than updating the BT device name as described above.
Click to expand...
Click to collapse
Thanks for the input! I am heading out of town for a few days but I'll look into your suggestions when i return ( i wont have my car with me so i cant do any testing). I do think the profile works because it shows as green when i turn my screen on and open tasker. It also works perfectly fine if i have my screen on then start my car.
I think it may be working now (successfully tested one time) but I will need to use a bit more to be sure. The only thing I noticed is when reinstalling, i was prompted to allow the application to run in the background and chose yes. When the app was transferred from my old phone and I imported the backup, i dont recall ever getting this prompt. Not sure where this setting is found other than at the prompt. I will report back once i am home and can test some more.
okay so it doesn't appear to be working still. The task works fine when played manually, the profile runs the task successfully when the screen is on/off/locked. It does NOT work after phone has been idle for a while. I have battery optimization off for Tasker and when I check battery usage, I can see that tasker runs all day long. I have another task to dismiss email notifications at work and it works fine when the phone is idle.
Starting to test it with different actions like turning on the screen but I'm running out of ideas. Only other thought it Adaptive Battery....not very familiar with it.
huviduc said:
okay so it doesn't appear to be working still. The task works fine when played manually, the profile runs the task successfully when the screen is on/off/locked. It does NOT work after phone has been idle for a while. I have battery optimization off for Tasker and when I check battery usage, I can see that tasker runs all day long. I have another task to dismiss email notifications at work and it works fine when the phone is idle.
Starting to test it with different actions like turning on the screen but I'm running out of ideas. Only other thought it Adaptive Battery....not very familiar with it.
Click to expand...
Click to collapse
Can you verify if the task runs at all? In other words, does Tasker successfully see the BT connection and activate the profile and the only thing that fails is Pandora playing?
If the profile actually kicks in, then it sounds like the phone needs to 'wake up' more before the Pandora action works.
I have a morning profile (runs based on time of day) that I had to add a wake screen step to to have all the actions work (I don't actually remember which action wasn't working -- it may have been that it didn't seen to run at all). I currently use the old Secure Settings plugin to do the screen wake because when I tried which auto- app has a screen wake action it didn't work.
piccit said:
Can you verify if the task runs at all? In other words, does Tasker successfully see the BT connection and activate the profile and the only thing that fails is Pandora playing?
If the profile actually kicks in, then it sounds like the phone needs to 'wake up' more before the Pandora action works.
I have a morning profile (runs based on time of day) that I had to add a wake screen step to to have all the actions work (I don't actually remember which action wasn't working -- it may have been that it didn't seen to run at all). I currently use the old Secure Settings plugin to do the screen wake because when I tried which auto- app has a screen wake action it didn't work.
Click to expand...
Click to collapse
This leads me to believe the bit I added for Secure Settings to wake CPU is what makes it work any time? The profile I have is very similar; %ATWORK = TRUE && BT connected to Bose SoundSport. Secure Settings wakes CPU only 20 seconds, launches Spotify, waits 5 seconds, simulates media control "next" then sets the volume to 10.
Can't hurt to try..
i added a task to vibrate the phone after trying to launch pandora. The phone seems to vibrate every time but pandora will only start if the screen is on. Thought it may be lock screen related so i totally disabled it, same results. Ill mess around with the secure settings tip above, the fact that it vibrates every time makes me think its something else though. Attached some logs below. Each set contains all logs from profile active to profile inactive.
EDIT --> work around found. Removing log in case there are any personal details
DELETED
DELETED
Comparing the logs in notepad++, they seem to be almost identical (with the exceptions of some of the timing of logs, had to move them around to match them up). The only difference I can see is the following lines and what appears to be Pandora starting up and exiting when it works ( events surrounded by #NLI: tickerText. The first line says True when screen is on and the second line is missing when pandora failed to load.
31-10-2018 M: 11.17.12#M: user present: false
31-10-2018 M: 11.17.12#M: startUAAA: need alarm: false
oddly enough... installing Secure Settings and using it to launch the same Pandora activity seems to work (so far)

Spotify stop the play when screen turn off [SOLVED]

Hi guys!
Recently had a problem with spotify, which every time the screen turned off the app stop playing music, returning, when turn on the screen.
I solved it that way:
Pressed the app icon, went to the app info> mobile data> will have two settings to enable there:
- Allow background data usage (usually on);
- Allow unrestricted data usage (disabled, i enabled and resolved the issue).
Another way to solve this is to turn off the power save mode, as doing so will automatically enable the "Allow unrestricted data use" option.
Hope this helps.
jmbdamata said:
Hi guys!
Recently had a problem with spotify, which every time the screen turned off the app stop playing music, returning, when turn on the screen.
I solved it that way:
Pressed the app icon, went to the app info> mobile data> will have two settings to enable there:
- Allow background data usage (usually on);
- Allow unrestricted data usage (disabled, i enabled and resolved the issue).
Another way to solve this is to turn off the power save mode, as doing so will automatically enable the "Allow unrestricted data use" option.
Hope this helps.
Click to expand...
Click to collapse
If you dont have premium (to be able to download playlists) you need background data.
I had it in sleeping apps and i had the same issue, so when doze was kicking in, i had too issues.
I'm about to root mine because I got a spotify malware app off someone's bluetooth. Infected my computer and my other phone too. So look out for that! My phone legit stopped my 2018 truck stereo from warning me about seatbelts ect ect....
Wødën said:
I'm about to root mine because I got a spotify malware app off someone's bluetooth. Infected my computer and my other phone too. So look out for that! My phone legit stopped my 2018 truck stereo from warning me about seatbelts ect ect....
Click to expand...
Click to collapse
Maybe you got a "Spotify malware app" when you were looking for a modded apk with free premium?

Any way to monitor apps that is no longer running in the background then restart it? (phone rooted)

I have used systemizer for the app and it will still stop running from time to time (as evident in output of the command 'ps -ef').
Maybe via cron by following something like this https://stackoverflow.com/questions/16747880/how-to-use-crontab-in-android ?
In my case the package that I want to keep alive all the time is com.surfshark.vpnclient.android . When it stops running in the background, it won't detect network status and enable VPN whenever necessary.
But even after setting autostart to on, exclude this app from battery optimization, and systemizing the app, it still fails to restart itself sometimes after it gets killed.
Any help appreciated !

Question How to prevent apps from auto starting at boot

Hello,
All is in the topic, I've got an app that starts automatically when my phone is powered on.
It is Aircall, an app I use for passing and receiving calls at work.
I would like this app not to start automatically each time I power on the phone.
Is there a setting for disabling some apps to autostart ? Or an app you can advise ?
Thanks for your help.
Check the app's preferences to see if there are options.
In the Android settings, go to Apps > See All > (your app. eg Air Call) > App battery usage and set it to 'restricted.' This will greatly restrict an app's ability to do many things in the background.
Other than that, you'd have to root your device to get any more control over the app using something like Servicely (Google Play Store), My Android Tools (apkmirror.com), Permission Manager X (fdroid), AppOppsX (fdroid), or Blocker (fdroid) to control the app's broadcast receivers. Apps can choose to respond to various phone states such as when a boot is completed, when network connectivity changes, power is connected/disconnected, etc. It can take some aggressive action to fully prevent an app from always running.
If you're just annoyed by a notification icon in your notification area you can always disable that app's notification so it doesn't appear.
I have tried all of these things to control apps but if apps use a lot of various broadcast receivers they will find ways to keep running. You may find stopping it to have unintended consequences. It being a work app, I'd consider simply disabling the app's notificaiton if it has a persistent notifcation or something. The next step would be to restrict the app as in 2. The most aggressive thing is to root and tinker with its broadcast receivers.
Hello jawz101,
Thank you very much for this very complete answer.
All your precise instructions are very interesting.
I'll have a look at all these solutions.
Thanks again.
I am not sure about straight forward solution. But I would like to use Greenify app. Add apps to it once and run it once everytime you restart your phone.

Categories

Resources