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 expectedDate = entry.getDate();
|
||||||
Date creationDate = keyRing.getCreationDate();
|
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");
|
throw new AssertionError("Creation date doesn't match the expected one");
|
||||||
}
|
}
|
||||||
entry.setKeyId(keyRing.getMasterKeyId());
|
entry.setKeyId(keyRing.getMasterKeyId());
|
||||||
|
|||||||
@@ -56,13 +56,11 @@ public class ImportKeysBindings {
|
|||||||
public static void setCreation(TextView textView, Date creationDate, boolean revokedOrExpired) {
|
public static void setCreation(TextView textView, Date creationDate, boolean revokedOrExpired) {
|
||||||
Context context = textView.getContext();
|
Context context = textView.getContext();
|
||||||
|
|
||||||
String text;
|
String text = "";
|
||||||
if (creationDate != null) {
|
if (creationDate != null) {
|
||||||
text = DateFormat.getDateFormat(context).format(creationDate);
|
text = DateFormat.getDateFormat(context).format(creationDate);
|
||||||
} else {
|
|
||||||
Resources resources = context.getResources();
|
|
||||||
text = resources.getString(R.string.unknown);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
textView.setText(text);
|
textView.setText(text);
|
||||||
textView.setTextColor(ImportKeysBindingsUtils.getColor(context, revokedOrExpired));
|
textView.setTextColor(ImportKeysBindingsUtils.getColor(context, revokedOrExpired));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user