This commit is contained in:
Horis
2025-09-15 14:34:03 +08:00
parent 910e5d5b6c
commit 8573eccfaf
2 changed files with 9 additions and 4 deletions
@@ -61,14 +61,14 @@ class WebService : BaseService() {
private val useWakeLock = appCtx.getPrefBoolean(PreferKey.webServiceWakeLock, false) private val useWakeLock = appCtx.getPrefBoolean(PreferKey.webServiceWakeLock, false)
private val wakeLock: PowerManager.WakeLock by lazy { private val wakeLock: PowerManager.WakeLock by lazy {
powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "legado:webService") powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "legado:WebService")
.apply { .apply {
setReferenceCounted(false) setReferenceCounted(false)
} }
} }
private val wifiLock by lazy { private val wifiLock by lazy {
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
wifiManager?.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, "legado:AudioPlayService") wifiManager?.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, "legado:WebService")
?.apply { ?.apply {
setReferenceCounted(false) setReferenceCounted(false)
} }
@@ -21,6 +21,7 @@ import androidx.core.view.isVisible
import io.legado.app.R import io.legado.app.R
import io.legado.app.base.adapter.ItemViewHolder import io.legado.app.base.adapter.ItemViewHolder
import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.base.adapter.RecyclerAdapter
import io.legado.app.constant.AppLog
import io.legado.app.constant.PreferKey import io.legado.app.constant.PreferKey
import io.legado.app.databinding.ItemTextBinding import io.legado.app.databinding.ItemTextBinding
import io.legado.app.databinding.PopupActionMenuBinding import io.legado.app.databinding.PopupActionMenuBinding
@@ -233,8 +234,12 @@ class TextActionMenu(private val context: Context, private val callBack: CallBac
else -> item.intent?.let { else -> item.intent?.let {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
kotlin.runCatching {
it.putExtra(Intent.EXTRA_PROCESS_TEXT, callBack.selectedText) it.putExtra(Intent.EXTRA_PROCESS_TEXT, callBack.selectedText)
context.startActivity(it) context.startActivity(it)
}.onFailure { e ->
AppLog.put("执行文本菜单操作出错\n$e", e, true)
}
} }
} }
} }