Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Always On Display, "No Title" is displayed #185

Closed
hybras opened this issue Apr 14, 2020 · 5 comments
Closed

On Always On Display, "No Title" is displayed #185

hybras opened this issue Apr 14, 2020 · 5 comments

Comments

@hybras
Copy link

hybras commented Apr 14, 2020

The problem seems to be the same one specified on this StackOverflow Thread. I will open a PR fixing this (if i even know what im doing).

@hybras
Copy link
Author

hybras commented Apr 14, 2020

I have no idea what I'm doing. It seems mNotificationBuilder.setContentTitle(String)
Needs to be called somewhere in MusicNotificationManager. But where exactly? It is already called in updateNotificationText. The notification text is updated when creating/updating a notification (both in MediaPlayerHolder.startForeground(). Does it have something to do with the string being HTML?

Anyways for reference, here is the Android Notification Overview.

@enricocid
Copy link
Owner

enricocid commented Apr 14, 2020

Thanks for reporting. The solution proposed on the stackoverflow thread You posted is applicable only on ExoPlayer.
Anyway, as for the SeekBar into the status bar (Android 10), I think that we need to put that information into the MediaSessionCompat to let the lockscreen gather informations, not the notification itself that is ok (contentTitle is already set).

If You can test (I can't unfortunately) You can try this:

Change updateSessionMetaData() to this:

private fun updateMediaSessionMetaData() {
        val mediaMediaPlayerCompat = MediaMetadataCompat.Builder().apply {
            if (VersioningHelper.isQ()) putLong(MediaMetadataCompat.METADATA_KEY_DURATION, currentSong.first?.duration!!)
            putString(MediaMetadataCompat.METADATA_KEY_ARTIST, currentSong.first?.artist)
            putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_SUBTITLE, currentSong.first?.album)
        }
        playerService.getMediaSession().setMetadata(mediaMediaPlayerCompat.build())
    }

And this line to this:

updateMediaSessionMetaData()

@ghost
Copy link

ghost commented Apr 14, 2020

I just tried your fix, it seems to work with and added line for the title. But i can only test title and album display since my device doesn't handle more than that.
I will create a pull request with the fix.
Edit: added fix in #186

@enricocid
Copy link
Owner

Thanks. This issue appears to be fixed so I'm closing for now :)

@enricocid
Copy link
Owner

enricocid commented Nov 3, 2020

Hi guys.
I have never asked for donations as I don't really need.

This time I'm asking You a little effort.

If You liked my work and You want to manifest support for my project please consider to donate to a friend of mine who is living a very difficult situation (lost his job and the home).

gofundme page

paypal

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants