ImportKeys: Set real date even if we don't have an expected date
This commit is contained in:
@@ -246,7 +246,9 @@ public class ImportKeysAdapter extends RecyclerView.Adapter<ImportKeysAdapter.Vi
|
||||
|
||||
Date expectedDate = entry.getDate();
|
||||
Date creationDate = keyRing.getCreationDate();
|
||||
if ((expectedDate != null) && !expectedDate.equals(creationDate)) {
|
||||
if (expectedDate == null) {
|
||||
entry.setDate(creationDate);
|
||||
} else if (!expectedDate.equals(creationDate)) {
|
||||
throw new AssertionError("Creation date doesn't match the expected one");
|
||||
}
|
||||
entry.setKeyId(keyRing.getMasterKeyId());
|
||||
|
||||
@@ -56,13 +56,11 @@ public class ImportKeysBindings {
|
||||
public static void setCreation(TextView textView, Date creationDate, boolean revokedOrExpired) {
|
||||
Context context = textView.getContext();
|
||||
|
||||
String text;
|
||||
String text = "";
|
||||
if (creationDate != null) {
|
||||
text = DateFormat.getDateFormat(context).format(creationDate);
|
||||
} else {
|
||||
Resources resources = context.getResources();
|
||||
text = resources.getString(R.string.unknown);
|
||||
}
|
||||
|
||||
textView.setText(text);
|
||||
textView.setTextColor(ImportKeysBindingsUtils.getColor(context, revokedOrExpired));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user