From d774b2df7c6433250d6ddf68bc29c0151a082a04 Mon Sep 17 00:00:00 2001 From: Horis <8674809+821938089@users.noreply.github.com> Date: Mon, 27 May 2024 15:56:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/service/BaseReadAloudService.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt b/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt index ffd15c7b6..04b5b5a06 100644 --- a/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt @@ -496,6 +496,8 @@ abstract class BaseReadAloudService : BaseService(), nSubtitle = getString(R.string.read_aloud_s) val builder = NotificationCompat .Builder(this@BaseReadAloudService, AppConst.channelIdReadAloud) + .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) + .setForegroundServiceBehavior(NotificationCompat.FOREGROUND_SERVICE_IMMEDIATE) .setSmallIcon(R.drawable.ic_volume_up) .setSubText(getString(R.string.read_aloud)) .setOngoing(true) @@ -535,7 +537,7 @@ abstract class BaseReadAloudService : BaseService(), androidx.media.app.NotificationCompat.MediaStyle() .setShowActionsInCompactView(0, 1, 2) ) - return builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC) + return builder } /**