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

Update notify method to strip escaped HTML characters. #775

Merged
merged 4 commits into from
Sep 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import androidx.annotation.StringRes
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.getSystemService
import androidx.core.graphics.drawable.toBitmap
import androidx.core.text.HtmlCompat
import coil.ImageLoader
import coil.request.ImageRequest
import kotlinx.coroutines.CoroutineScope
Expand Down Expand Up @@ -258,8 +259,8 @@ class RemotePlayerService : Service(), CoroutineScope {
} else {
setPriority(Notification.PRIORITY_LOW)
}
setContentTitle(title)
setContentText(artist)
setContentTitle(title?.let { HtmlCompat.fromHtml(it, HtmlCompat.FROM_HTML_MODE_LEGACY) })
setContentText(artist?.let { HtmlCompat.fromHtml(it, HtmlCompat.FROM_HTML_MODE_LEGACY) })
setSubText(album)
if (position != PlaybackState.PLAYBACK_POSITION_UNKNOWN) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
Expand Down