From 25f0a7dabafd743131b54ad95f8741ead956c607 Mon Sep 17 00:00:00 2001 From: LeanBitLab Date: Sun, 15 Nov 2026 14:55:55 +0530 Subject: [PATCH] fix(log): keep typed words out of the log The log is also kept in memory and can be saved from the app, so it should not contain typed text. The word added to the personal dictionary and the emoji search query are not logged any more (the length is enough for the search). --- .../helium314/keyboard/keyboard/emoji/EmojiPalettesView.kt | 4 ++-- .../helium314/keyboard/latin/DictionaryFacilitatorImpl.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/helium314/keyboard/keyboard/emoji/EmojiPalettesView.kt b/app/src/main/java/helium314/keyboard/keyboard/emoji/EmojiPalettesView.kt index 19a1582ea..145f3f888 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/emoji/EmojiPalettesView.kt +++ b/app/src/main/java/helium314/keyboard/keyboard/emoji/EmojiPalettesView.kt @@ -962,7 +962,7 @@ class EmojiPalettesView @JvmOverloads constructor( } private fun performSearch(query: String?) { - Log.d("EmojiSearch", "performSearch: $query") + Log.d("EmojiSearch", "performSearch: ${query?.length ?: 0} chars") val dict = sDictionaryFacilitator if (dict == null || query.isNullOrEmpty()) { mSearchAdapter?.submitList(Collections.emptyList()) @@ -984,7 +984,7 @@ class EmojiPalettesView @JvmOverloads constructor( } } - Log.d("EmojiSearch", "Found ${results.size} results for: $query") + Log.d("EmojiSearch", "Found ${results.size} results") mSearchAdapter?.submitList(results) mSearchResultsList?.scrollToPosition(0) diff --git a/app/src/main/java/helium314/keyboard/latin/DictionaryFacilitatorImpl.kt b/app/src/main/java/helium314/keyboard/latin/DictionaryFacilitatorImpl.kt index c6e62d192..09e3990b3 100644 --- a/app/src/main/java/helium314/keyboard/latin/DictionaryFacilitatorImpl.kt +++ b/app/src/main/java/helium314/keyboard/latin/DictionaryFacilitatorImpl.kt @@ -517,9 +517,9 @@ class DictionaryFacilitatorImpl : DictionaryFacilitator { val localeToUse = if (dictionaryGroup.locale.language.isNullOrEmpty()) null else dictionaryGroup.locale UserDictionary.Words.addWord(userDict.mContext, wordToUse, 250, null, localeToUse) userDict.addUnigramEntry(wordToUse, 250, null, 0, false, false, (System.currentTimeMillis() / 1000).toInt()) - Log.i(TAG, "Added word '$wordToUse' to personal dictionary for locale $localeToUse (typed $count times, threshold $threshold)") + Log.i(TAG, "Added a word to the personal dictionary for locale $localeToUse (typed $count times, threshold $threshold)") }.onFailure { - Log.w(TAG, "Failed to add word '$wordToUse' to personal dictionary", it) + Log.w(TAG, "Failed to add a word to the personal dictionary", it) } } }