mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Fix clean clipboard after killing app by swap
This commit is contained in:
@@ -72,11 +72,7 @@ class ClipboardEntryNotificationService : EntryNotificationService() {
|
|||||||
}
|
}
|
||||||
ACTION_CLEAN_CLIPBOARD == intent.action -> {
|
ACTION_CLEAN_CLIPBOARD == intent.action -> {
|
||||||
stopTask(cleanCopyNotificationTimerTask)
|
stopTask(cleanCopyNotificationTimerTask)
|
||||||
try {
|
cleanClipboard()
|
||||||
clipboardHelper?.cleanClipboard()
|
|
||||||
} catch (e: SamsungClipboardException) {
|
|
||||||
Log.e(TAG, "Clipboard can't be cleaned", e)
|
|
||||||
}
|
|
||||||
stopNotificationAndSendLockIfNeeded()
|
stopNotificationAndSendLockIfNeeded()
|
||||||
}
|
}
|
||||||
else -> for (actionKey in ClipboardEntryNotificationField.allActionKeys) {
|
else -> for (actionKey in ClipboardEntryNotificationField.allActionKeys) {
|
||||||
@@ -204,11 +200,7 @@ class ClipboardEntryNotificationService : EntryNotificationService() {
|
|||||||
notificationManager?.cancel(myNotificationId)
|
notificationManager?.cancel(myNotificationId)
|
||||||
// Clean password only if no next field
|
// Clean password only if no next field
|
||||||
if (nextFields.size <= 0)
|
if (nextFields.size <= 0)
|
||||||
try {
|
cleanClipboard()
|
||||||
clipboardHelper?.cleanClipboard()
|
|
||||||
} catch (e: SamsungClipboardException) {
|
|
||||||
Log.e(TAG, "Clipboard can't be cleaned", e)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
cleanCopyNotificationTimerTask?.start()
|
cleanCopyNotificationTimerTask?.start()
|
||||||
} else {
|
} else {
|
||||||
@@ -222,6 +214,20 @@ class ClipboardEntryNotificationService : EntryNotificationService() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun cleanClipboard() {
|
||||||
|
try {
|
||||||
|
clipboardHelper?.cleanClipboard()
|
||||||
|
} catch (e: SamsungClipboardException) {
|
||||||
|
Log.e(TAG, "Clipboard can't be cleaned", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onTaskRemoved(rootIntent: Intent?) {
|
||||||
|
cleanClipboard()
|
||||||
|
|
||||||
|
super.onTaskRemoved(rootIntent)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
|
|
||||||
stopTask(cleanCopyNotificationTimerTask)
|
stopTask(cleanCopyNotificationTimerTask)
|
||||||
|
|||||||
Reference in New Issue
Block a user