meganz / android

MEGA Android App
Other
1.59k stars 371 forks source link

Streaming Audio notification keeps closing by itself when paused #176

Open Pentaphon opened 2 years ago

Pentaphon commented 2 years ago

General Information

What happened?

The audio notification keeps closing when streaming audio is paused and I use my phone for something else like taking calls, forcing me to open the app again the next time I want to stream audio, instead of staying active so I can continue streaming audio from the notification. I suspect this is because Mega keeps being kicked out of memory but the audio notification should stay in place no matter what like in other audio players such as podcast clients.

What did you expect to happen?

I expected the audio notification to stay in place when streaming audio is paused unless I close it myself.

javiergm1983 commented 2 years ago

Hi @Pentaphon I have tested and cannot reprouce your issue. Do you have the setting "Media > Audio files > Playing on the background" enabled?

Please, could you attach a screen recording reproducing the issue? Thanks.

Pentaphon commented 2 years ago

Yes, I have that enabled but I don't think I will be able to screen record the issue because it is very unpredictable. I am looking more for a way to make sure the player notification stays active no matter what instead of it being possible to have it close by itself. I notice the notification goes into "silent mode" when it is paused. Not sure if that has anything to do with it. I also don't know why the notification isn't grouped with other audio notifications like they are on Android 11.

javiergm1983 commented 2 years ago

Do you have any battery saver enabled?

Pentaphon commented 2 years ago

Do you have any battery saver enabled?

No, but battery optimization was enabled for the MEGA app. I have just changed it to "not optimized" and I will continue to monitor MEGA to see if the audio notification still closes by itself when I do something else on my phone.

Pentaphon commented 2 years ago

Do you have any battery saver enabled?

After having the Mega app "not optimized" for a few days I can definitely say that the audio notification does not stay in place while doing other things on my phone. Not sure why it happens but it would be nice to have a way to keep the notification alive when it is paused.

Here is how the Mega notification and Pocket Casts notifications look when they are paused on Android 11. The Pocket Casts notification never seems to get kicked out of memory unless I close it myself. I think Pocket Casts uses a different method of keeping the notification alive.

Screenshot_20220123-101048_1

javiergm1983 commented 2 years ago

Hi @Pentaphon, from what I can see, the MEGA audio notification looks fine. If you tap in the play icon the audio playing should resume... As I said before I cannot reproduce your issue althought I have tested in two different Android 11 devices, so maybe is a specific device issue of Moto devices.

Anyway I will ask our QA team to try reproduce it.

javiergm1983 commented 2 years ago

Seems that our QA team cannot also reproduce the issue... Here is what they reported for now.

I tried to reproduce the issue in a Samsung Android 11 device. i can´t reproduce the issue. You can resume the audio using the notification button. The only difference between MEGA and streaming audio providers (like , spotify or pocket cast). It is that when you turn off the notification that interrrupted the audio, in MEGA it does not play automatically, but I can resume the audio using the "play" button of the notification

Pentaphon commented 2 years ago

I tried to reproduce the issue in a Samsung Android 11 device.

That device probably has a lot of RAM. My device has 3GB of RAM so maybe on lower-RAM devices, Mega doesn't survive for long.

I didn't expect a successful reproduction of my issue since there's no specific way to make the Mega notification go away. It just goes away by itself with normal use for me when it is paused.

Perhaps there is something else that can be done to ensure the Mega notification stays in place no matter what? Something to keep it from getting kicked out of memory?

Also, I must ask, why isn't the Mega notification grouped with the other audio notifications for other apps on Android 11? This was a big change in Android 11 that groups all my audio notifications together but for some reason, the Mega audio notification isn't included? Does this mean Mega isn't totally Android 11 ready? Here is how audio notifications are supposed to be grouped in Android 11 devices according to the official Android Developers blog.

https://android-developers.googleblog.com/2020/08/playing-nicely-with-media-controls.html

media-controls