Refactored to reduce coupling between ChangeUnlockParcel and SaveKeyringParcel
This commit is contained in:
@@ -33,6 +33,10 @@ public class ChangeUnlockParcel implements Parcelable {
|
||||
// The new passphrase to use
|
||||
public final Passphrase mNewPassphrase;
|
||||
|
||||
public ChangeUnlockParcel(Passphrase newPassphrase) {
|
||||
mNewPassphrase = newPassphrase;
|
||||
}
|
||||
|
||||
public ChangeUnlockParcel(Long masterKeyId, byte[] fingerprint, Passphrase newPassphrase) {
|
||||
if (newPassphrase == null) {
|
||||
throw new AssertionError("newPassphrase must be non-null. THIS IS A BUG!");
|
||||
|
||||
@@ -103,11 +103,15 @@ public class SaveKeyringParcel implements Parcelable {
|
||||
mKeyserver = keysever;
|
||||
}
|
||||
|
||||
public void setNewUnlock(Passphrase passphrase) {
|
||||
mNewUnlock = new ChangeUnlockParcel(mMasterKeyId, mFingerprint, passphrase);
|
||||
public void setNewUnlock(ChangeUnlockParcel parcel) {
|
||||
mNewUnlock = parcel;
|
||||
}
|
||||
|
||||
public ChangeUnlockParcel getChangeUnlockParcel() {
|
||||
if(mNewUnlock != null) {
|
||||
mNewUnlock.mMasterKeyId = mMasterKeyId;
|
||||
mNewUnlock.mFingerprint = mFingerprint;
|
||||
}
|
||||
return mNewUnlock;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user