From c10d56bc7ba1d53c0fbfa7178ff74b186834dc0e Mon Sep 17 00:00:00 2001 From: codokie <@> Date: Tue, 16 Apr 2024 10:45:30 +0300 Subject: [PATCH] do not coerce non-text --- .../java/helium314/keyboard/latin/ClipboardHistoryManager.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/helium314/keyboard/latin/ClipboardHistoryManager.kt b/app/src/main/java/helium314/keyboard/latin/ClipboardHistoryManager.kt index b35d44c1b..340274baa 100644 --- a/app/src/main/java/helium314/keyboard/latin/ClipboardHistoryManager.kt +++ b/app/src/main/java/helium314/keyboard/latin/ClipboardHistoryManager.kt @@ -48,7 +48,7 @@ class ClipboardHistoryManager( private fun fetchPrimaryClip() { val clipData = clipboardManager.primaryClip ?: return - if (clipData.itemCount == 0) return + if (clipData.itemCount == 0 || clipData.description?.hasMimeType("text/*") == false) return clipData.getItemAt(0)?.let { clipItem -> val timeStamp = ClipboardManagerCompat.getClipTimestamp(clipData) ?: System.currentTimeMillis() val content = clipItem.coerceToText(latinIME)