Music-Player-GO icon indicating copy to clipboard operation
Music-Player-GO copied to clipboard

[BUG] For songs without a cover: no navigational buttons drawn except play/pause

Open sycam0r-e opened this issue 3 years ago β€’ 33 comments

  1. Describe the bug When I start playback of music, there are no buttons drawn for pausing, fowarding, playing etc. both on the lock screen and in the notification centre. Note that a touch to the area does produce the intended action though.

  2. To Reproduce the behaviour

    1. Play any music track.
    2. Pull down to see notification centre or lock phone to see lock screen.
    3. See error!
  3. Expected behavior The navigation buttons should be displayed.

  4. Smartphone

  • Device: Pixel 4a
  • OS: Android 12
  • ROM or mods: GrapheneOS Build SQ1.220105.002.2022013120
  • MusicPlayerGo version: 4.412
  1. Screenshots

Additional context

  • The error persists across phone restarts and across GrapheneOS updates.
  • I think it started with the MusicPlayerGo version that introduced the new dark theme which led to #350 but I am not certain.
  • I am using MusicPlayerGo in a user profile, which hasn't led to any problems so far.

sycam0r-e avatar Feb 01 '22 14:02 sycam0r-e

Hi, thanks for letting me know.

Could you try disabling album covers option and see what happens?

What happens if you click where the actions should appear?

enricocid avatar Feb 02 '22 07:02 enricocid

Damnit, knew I would forget something! :)

What happens if you click where the actions should appear?

A touch to the area where the button would be does produce the correct action, the buttons are just not drawn. This issue seems to happen with several music players and the GrapheneOS team seems convinced that it's not caused by GrapheneOS or even AOSP, but I'm not sure (see https://github.com/GrapheneOS/os-issue-tracker/issues/754).

Could you try disabling album covers option and see what happens?

I am not sure what you mean here. I disabled "Settings->General->Embedded album covers". I am not sure whether this should change displaying the cover in the screenshots above? If so, it doesn't, everything stays the same.

(In the meantime, there was an update for GrapheneOS, but the error persists. I amended my first post accordingly.)

sycam0r-e avatar Feb 02 '22 10:02 sycam0r-e

So actions are invisible even with embedded covers are disabled?

Yeah, weird issue. Everything works good on aosp emulator.

Gonna investigate the issue. Will post test apk in the future.

Sadly I don't have a device running android 12 and can't reproduce this issue, so I need You to test changes 😊

enricocid avatar Feb 02 '22 11:02 enricocid

So actions are invisible even with embedded covers are disabled?

Yes. ~~Additionally, the cover is still visible, not sure whether this is intended.~~ Edit: The cover does disappear if embedded cover is disabled, I tested this wrongly.

Sadly I don't have a device running android 12 and can't reproduce this issue, so I need You to test changes 😊

Sure thing, I'm happy to help! Thanks for your work! :)

sycam0r-e avatar Feb 02 '22 11:02 sycam0r-e

Thank you!

Notifications not updating is another bug. Shame on emulatorsπŸ˜‚

Could you test builds from here?

https://github.com/enricocid/Music-Player-GO/releases

4.4.12 and 4.4.11

Be sure to disable battery optimization 😊 Thanks.πŸ™πŸ»

enricocid avatar Feb 02 '22 11:02 enricocid

I tested both with disabled battery optimization. The bug persists.

sycam0r-e avatar Feb 02 '22 12:02 sycam0r-e

Hi, could you check if this player works?

Thanks

https://github.com/OxygenCobalt/Auxio

@OxygenCobalt

enricocid avatar Feb 04 '22 11:02 enricocid

I checked Auxio in a new user profile with disabled battery optimization and with disabled embedded covers: it doesn't work, the buttons are not drawn.

sycam0r-e avatar Feb 08 '22 13:02 sycam0r-e

Seems like a system-specific issue. I've had situations where SystemUI permanently mangles some element for no reason and the only way to fix it is to factory reset the OS.

OxygenCobalt avatar Feb 11 '22 03:02 OxygenCobalt

Yep, that's a weird bug.

Can't find the issue with my code ... I'm copying & pasting the code for notifications directly from Google guidelines.

I've noticed, for example, that switching profiles on Android 10/lineageos causes system UI to draw status bar over the toolbars and other UI issues...

enricocid avatar Feb 11 '22 07:02 enricocid

https://github.com/GrapheneOS/os-issue-tracker/issues/933#issuecomment-1030706962

enricocid avatar Feb 11 '22 08:02 enricocid

I tend to agree.

(I fairly recently did a factory reset (for other reasons, the bug issued here happened at some point after the reset). I didn't manipulate any permissions or sys settings though that were temporally close to the emergence of this bug so I have no clue.)

I won't factory reset in the near future. When I do, I will observe how MusicPlayerGo (and Auxio) behave and will report.

Feel free to close this issue in the meantime or let me know if there is anything else I can test. :) Thanks for your time and work! :)

sycam0r-e avatar Feb 11 '22 15:02 sycam0r-e

Interesting development:

My OS (GrapheneOS) has been on Android 13 for a while now (but not when this issue started).

I just updated Music Player GO to 4.4.22 which implements support for Android 13.

Now, the navigation buttons are drawn everywhere, BUT if a song does not have a cover, only the play/paus button is drawn.

Note that I did not factory reset my phone in the meantime.

Does this crack the riddle?

sycam0r-e avatar Oct 10 '22 19:10 sycam0r-e

Can you show a screenshot @flippflapp?

OxygenCobalt avatar Oct 10 '22 19:10 OxygenCobalt

@OxygenCobalt sure thing, here you go:

sycam0r-e avatar Oct 10 '22 20:10 sycam0r-e

Ah, that's not an issue with the system UI, MPGO is simply uploading a default cover that makes the color calculation not work properly, obscuring the UI in the process.

@enricocid You may want to stop providing your default cover icon to the notification and simply pass null to METADATA_KEY_ALBUM_ART/setLargeIcon. That's what I do and the placeholders provided by the system tend to work quite well.

OxygenCobalt avatar Oct 10 '22 20:10 OxygenCobalt

Otherwise, I think we can close this issue since it's resolved on GrapheneOS's end.

OxygenCobalt avatar Oct 10 '22 20:10 OxygenCobalt

Let me know if you want me to test a test-apk.

sycam0r-e avatar Oct 10 '22 20:10 sycam0r-e

@OxygenCobalt Already doing πŸ˜†

https://github.com/enricocid/Music-Player-GO/blob/0a40c107865e1b3f65cfa2f12c893e158bd6c4bd/project/app/src/main/java/com/iven/musicplayergo/extensions/MusicExts.kt#L97

enricocid avatar Oct 10 '22 20:10 enricocid

No idea whether this is related, see #477 which I just filed.

sycam0r-e avatar Oct 10 '22 20:10 sycam0r-e

Yes, there's something wrong in that extension πŸ˜† I'll post an apk later (sorry, but I still don't have A13 running on my device, only emulator)

enricocid avatar Oct 10 '22 20:10 enricocid

No worries at all, don't stress! Thanks so much for your work! :) Just ping me when you have an apk and I'll test it (probably tomorrow).

sycam0r-e avatar Oct 10 '22 20:10 sycam0r-e

Sorry if I was unclear, but the test-apk over here did not this this issue :(

sycam0r-e avatar Oct 13 '22 11:10 sycam0r-e

Could you post me some screenshots?

  1. Cover option disabled
  2. Cover option enabled (but no cover available)
  3. Cover option enabled (cover available)

Thanks :)

enricocid avatar Oct 13 '22 11:10 enricocid

setColor and setColorized set to true is probably causing the issue @OxygenCobalt null is already passed on error and when cover option is disabled

@flippflapp Test apk: https://drive.google.com/file/d/1bLgg6SJog2yNMvyIRllcgbu3WI3bGqT4/view?usp=sharing

enricocid avatar Oct 13 '22 12:10 enricocid

@enricocid the bug persists:

  1. Cover option disabled (cover available):

  2. Cover option enabled (but no cover available)

  3. Cover option enabled (cover available)

sycam0r-e avatar Oct 13 '22 13:10 sycam0r-e

@enricocid Yeah, colorization isn't really meant to be used for media notifications.

To be honest, I cannot put into words how terrible the media session/notification API is. They really need to throw the whole thing out and start again.

OxygenCobalt avatar Oct 13 '22 16:10 OxygenCobalt

@flippflapp

https://github.com/enricocid/Music-Player-GO/actions/runs/3244035001

You can try the apk that will be posted here once built :) Code is now similar to auxio

The extension to load covers should be ok, I think https://github.com/enricocid/Music-Player-GO/blob/19b4627ea960afcbba8487b0e489b145c669e786/project/app/src/main/java/com/iven/musicplayergo/extensions/MusicExts.kt#L97

I'm confused @OxygenCobalt

:)

enricocid avatar Oct 13 '22 16:10 enricocid

That is basically the bitmap loading routine I use @enricocid. Looks fine. I was just annoyed the MediaSession API in general, not your code.

OxygenCobalt avatar Oct 13 '22 16:10 OxygenCobalt

I'd wipe the entire Android ecosystem with a flamethrower xd

enricocid avatar Oct 13 '22 16:10 enricocid