From 1ed1d4233f78ca5b29c6738d480cd0ca246d50ef Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Tue, 19 Apr 2022 16:06:16 +0200 Subject: [PATCH] Allow to add entry with no info in Magikeyboard --- .../KeyboardEntryNotificationService.kt | 31 +++++++------------ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/com/kunzisoft/keepass/services/KeyboardEntryNotificationService.kt b/app/src/main/java/com/kunzisoft/keepass/services/KeyboardEntryNotificationService.kt index 031a4c1ed..e74b34c22 100644 --- a/app/src/main/java/com/kunzisoft/keepass/services/KeyboardEntryNotificationService.kt +++ b/app/src/main/java/com/kunzisoft/keepass/services/KeyboardEntryNotificationService.kt @@ -149,30 +149,21 @@ class KeyboardEntryNotificationService : LockNotificationService() { fun launchNotificationIfAllowed(context: Context, entry: EntryInfo, toast: Boolean) { - val containsURLToCopy = entry.url.isNotEmpty() - val containsUsernameToCopy = entry.username.isNotEmpty() - val containsPasswordToCopy = entry.password.isNotEmpty() - val containsExtraFieldToCopy = entry.customFields.isNotEmpty() - var startService = false val intent = Intent(context, KeyboardEntryNotificationService::class.java) - if (containsURLToCopy || containsUsernameToCopy || containsPasswordToCopy || containsExtraFieldToCopy) { - if (toast) { - Toast.makeText(context, - context.getString(R.string.keyboard_notification_entry_content_title, entry.title), - Toast.LENGTH_SHORT).show() - } + if (toast) { + Toast.makeText(context, + context.getString(R.string.keyboard_notification_entry_content_title, entry.title), + Toast.LENGTH_SHORT).show() + } - // Show the notification if allowed in Preferences - if (PreferencesUtil.isKeyboardNotificationEntryEnable(context)) { - startService = true - context.startService(intent.apply { - putExtra(ENTRY_INFO_KEY, entry) - }) - } - } else { - MagikeyboardService.removeEntry(context) + // Show the notification if allowed in Preferences + if (PreferencesUtil.isKeyboardNotificationEntryEnable(context)) { + startService = true + context.startService(intent.apply { + putExtra(ENTRY_INFO_KEY, entry) + }) } if (!startService)