sort confirmed keys before unconfirmed primary ones (OKC-01-011)

This commit is contained in:
Vincent Breitmoser
2015-09-11 03:56:07 +02:00
parent 476d153db2
commit 486117d9de

View File

@@ -771,6 +771,11 @@ public class ProviderHelper {
if (type != o.type) {
return type == null ? -1 : 1;
}
// if one is *trusted* but the other isn't, that one comes first
// this overrides the primary attribute, even!
if ( (trustedCerts.size() == 0) != (o.trustedCerts.size() == 0) ) {
return trustedCerts.size() > o.trustedCerts.size() ? -1 : 1;
}
// if one key is primary but the other isn't, the primary one always comes first
if (isPrimary != o.isPrimary) {
return isPrimary ? -1 : 1;