ImportKeys: Use the parsed key status and avoid deprecated method
This commit is contained in:
@@ -29,18 +29,17 @@ import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/** A generic wrapped PGPKeyRing object.
|
||||
*
|
||||
/**
|
||||
* A generic wrapped PGPKeyRing object.
|
||||
* <p>
|
||||
* This class provides implementations for all basic getters which both
|
||||
* PublicKeyRing and SecretKeyRing have in common. To make the wrapped keyring
|
||||
* class typesafe in implementing subclasses, the field is stored in the
|
||||
* implementing class, providing properly typed access through the getRing
|
||||
* getter method.
|
||||
*
|
||||
*/
|
||||
public abstract class CanonicalizedKeyRing extends KeyRing {
|
||||
|
||||
@@ -80,7 +79,7 @@ public abstract class CanonicalizedKeyRing extends KeyRing {
|
||||
|
||||
public boolean isRevoked() {
|
||||
// Is the master key revoked?
|
||||
return getRing().getPublicKey().isRevoked();
|
||||
return getRing().getPublicKey().hasRevocation();
|
||||
}
|
||||
|
||||
public Date getCreationDate() {
|
||||
@@ -136,8 +135,10 @@ public abstract class CanonicalizedKeyRing extends KeyRing {
|
||||
getRing().encode(stream);
|
||||
}
|
||||
|
||||
/** Returns an UncachedKeyRing which wraps the same data as this ring. This method should
|
||||
* only be used */
|
||||
/**
|
||||
* Returns an UncachedKeyRing which wraps the same data as this ring. This method should
|
||||
* only be used
|
||||
*/
|
||||
public UncachedKeyRing getUncachedKeyRing() {
|
||||
return new UncachedKeyRing(getRing());
|
||||
}
|
||||
|
||||
@@ -208,6 +208,9 @@ public class ImportKeysAdapter extends RecyclerView.Adapter<ImportKeysAdapter.Vi
|
||||
|
||||
ImportKeysListEntry entry = mData.get(mCurrent);
|
||||
|
||||
entry.setRevoked(keyRing.isRevoked());
|
||||
entry.setExpired(keyRing.isExpired());
|
||||
|
||||
entry.setDate(keyRing.getCreationDate());
|
||||
entry.setKeyId(keyRing.getMasterKeyId());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user