diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-08-05 20:52:29 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-08-05 20:52:29 +0200 |
commit | f8a222983efe5741a0d79147c6724a49ad7e5b3a (patch) | |
tree | 7979c933ce4d339035ee3b8eabdce9321fd6a326 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java | |
parent | 39380a361718201fdefa86628fb0deb8771deaa4 (diff) | |
download | open-keychain-f8a222983efe5741a0d79147c6724a49ad7e5b3a.tar.gz open-keychain-f8a222983efe5741a0d79147c6724a49ad7e5b3a.tar.bz2 open-keychain-f8a222983efe5741a0d79147c6724a49ad7e5b3a.zip |
Use PublicKeyAlgorithmTags instead of homebrew choices constants, fix expiry selection for adding new subkeys
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java index dd972866c..e845c7e42 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SubkeysAdapter.java @@ -95,9 +95,13 @@ public class SubkeysAdapter extends CursorAdapter { return mCursor.getLong(INDEX_CREATION); } - public long getExpiryDate(int position) { + public Long getExpiryDate(int position) { mCursor.moveToPosition(position); - return mCursor.getLong(INDEX_EXPIRY); + if (mCursor.isNull(INDEX_EXPIRY)) { + return null; + } else { + return mCursor.getLong(INDEX_EXPIRY); + } } @Override @@ -178,8 +182,9 @@ public class SubkeysAdapter extends CursorAdapter { SaveKeyringParcel.SubkeyChange subkeyChange = mSaveKeyringParcel.getSubkeyChange(keyId); if (subkeyChange != null) { - // 0 is "no expiry" - if (subkeyChange.mExpiry != null && subkeyChange.mExpiry != 0) { + if (subkeyChange.mExpiry == null) { + expiryDate = null; + } else { expiryDate = new Date(subkeyChange.mExpiry * 1000); } } |