Skip to content

Commit

Permalink
Update notify method to strip escaped HTML characters. (#775)
Browse files Browse the repository at this point in the history
* Update notify method to strip escaped HTML characters.

* Move strip out of helper function to RemotePlayerService.

* Use implicit lambda parameter.
  • Loading branch information
colonelpopcorn authored Sep 9, 2022
1 parent dbb48e4 commit 23794a8
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 23794a8

Please sign in to comment.