fix keys with no expiry in ui code

This commit is contained in:
Vincent Breitmoser 2014-08-14 22:12:07 +02:00
parent bc76941bc1
commit 09d37a5fa6
3 changed files with 9 additions and 4 deletions

View File

@ -205,14 +205,19 @@ public abstract class OperationResults {
public EditKeyResult(Parcel source) {
super(source);
mRingMasterKeyId = source.readLong();
mRingMasterKeyId = source.readInt() != 0 ? source.readLong() : null;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
if (mRingMasterKeyId == null) {
dest.writeInt(0);
} else {
dest.writeInt(1);
dest.writeLong(mRingMasterKeyId);
}
}
public static Creator<EditKeyResult> CREATOR = new Creator<EditKeyResult>() {
public EditKeyResult createFromParcel(final Parcel source) {

View File

@ -183,7 +183,7 @@ public class SubkeysAdapter extends CursorAdapter {
SaveKeyringParcel.SubkeyChange subkeyChange = mSaveKeyringParcel.getSubkeyChange(keyId);
if (subkeyChange != null) {
if (subkeyChange.mExpiry == null) {
if (subkeyChange.mExpiry == null || subkeyChange.mExpiry == 0L) {
expiryDate = null;
} else {
expiryDate = new Date(subkeyChange.mExpiry * 1000);

View File

@ -141,7 +141,7 @@ public class EditSubkeyExpiryDialogFragment extends DialogFragment {
dismiss();
Bundle data = new Bundle();
data.putSerializable(MESSAGE_DATA_EXPIRY_DATE, null);
data.putSerializable(MESSAGE_DATA_EXPIRY_DATE, 0L);
sendMessageToHandler(MESSAGE_NEW_EXPIRY_DATE, data);
}
});