mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Allow notifications for all fields
This commit is contained in:
@@ -147,7 +147,7 @@ public class EntryActivity extends LockingHideActivity {
|
||||
// If notifications enabled in settings
|
||||
// Don't if application timeout
|
||||
if (firstLaunchOfActivity && !App.isShutdown() && isClipboardNotificationsEnable(getApplicationContext())) {
|
||||
if (mEntry.getPassword().length() > 0) {
|
||||
if (mEntry.getUsername().length() > 0 || mEntry.getPassword().length() > 0 || mEntry.containsExtraFields()) {
|
||||
// username already copied, waiting for user's action before copy password.
|
||||
Intent intent = new Intent(this, NotificationCopyingService.class);
|
||||
intent.setAction(NotificationCopyingService.ACTION_NEW_NOTIFICATION);
|
||||
@@ -163,11 +163,12 @@ public class EntryActivity extends LockingHideActivity {
|
||||
mEntry.getUsername(),
|
||||
getResources()));
|
||||
// Add password to notifications
|
||||
notificationFields.add(
|
||||
new NotificationField(
|
||||
NotificationField.NotificationFieldId.PASSWORD,
|
||||
mEntry.getPassword(),
|
||||
getResources()));
|
||||
if (mEntry.getPassword().length() > 0)
|
||||
notificationFields.add(
|
||||
new NotificationField(
|
||||
NotificationField.NotificationFieldId.PASSWORD,
|
||||
mEntry.getPassword(),
|
||||
getResources()));
|
||||
// Add extra fields
|
||||
if (mEntry.allowExtraFields()) {
|
||||
try {
|
||||
|
||||
@@ -163,6 +163,14 @@ public abstract class PwEntry extends PwNode implements Cloneable {
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* If entry contains extra fields
|
||||
* @return true if there is extra fields
|
||||
*/
|
||||
public boolean containsExtraFields() {
|
||||
return !getExtraProtectedFields().keySet().isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an extra field to the list
|
||||
* @param label Label of field, must be unique
|
||||
|
||||
Reference in New Issue
Block a user