mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-24 07:58:50 -05:00
Create key: make single user id primary user id, other cleanup
This commit is contained in:
parent
369f6e080c
commit
160e6972d8
@ -207,6 +207,7 @@ public class SaveKeyringParcel implements Parcelable {
|
||||
public String toString() {
|
||||
String out = "mMasterKeyId: " + mMasterKeyId + "\n";
|
||||
out += "mNewPassphrase: " + mNewPassphrase + "\n";
|
||||
out += "mAddUserIds: " + mAddUserIds + "\n";
|
||||
out += "mAddSubKeys: " + mAddSubKeys + "\n";
|
||||
out += "mChangeSubKeys: " + mChangeSubKeys + "\n";
|
||||
out += "mChangePrimaryUserId: " + mChangePrimaryUserId + "\n";
|
||||
|
@ -174,6 +174,7 @@ public class CreateKeyFinalFragment extends Fragment {
|
||||
parcel.mAddSubKeys.add(new SaveKeyringParcel.SubkeyAdd(Constants.choice.algorithm.rsa, 4096, KeyFlags.ENCRYPT_COMMS | KeyFlags.ENCRYPT_STORAGE, null));
|
||||
String userId = KeyRing.createUserId(mName, mEmail, null);
|
||||
parcel.mAddUserIds.add(userId);
|
||||
parcel.mChangePrimaryUserId = userId;
|
||||
parcel.mNewPassphrase = mPassphrase;
|
||||
|
||||
// get selected key entries
|
||||
|
@ -48,7 +48,6 @@ public class EditSubkeyExpiryDialogFragment extends DialogFragment {
|
||||
public static final String MESSAGE_DATA_EXPIRY_DATE = "expiry_date";
|
||||
|
||||
private Messenger mMessenger;
|
||||
private Calendar mCreationCal;
|
||||
private Calendar mExpiryCal;
|
||||
|
||||
private DatePicker mDatePicker;
|
||||
@ -79,8 +78,8 @@ public class EditSubkeyExpiryDialogFragment extends DialogFragment {
|
||||
Date creationDate = new Date(getArguments().getLong(ARG_CREATION_DATE) * 1000);
|
||||
Date expiryDate = new Date(getArguments().getLong(ARG_EXPIRY_DATE) * 1000);
|
||||
|
||||
mCreationCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
|
||||
mCreationCal.setTime(creationDate);
|
||||
Calendar creationCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
|
||||
creationCal.setTime(creationDate);
|
||||
mExpiryCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
|
||||
mExpiryCal.setTime(expiryDate);
|
||||
|
||||
@ -101,11 +100,11 @@ public class EditSubkeyExpiryDialogFragment extends DialogFragment {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
|
||||
// will crash with IllegalArgumentException if we set a min date
|
||||
// that is not before expiry
|
||||
if (mCreationCal != null && mCreationCal.before(mExpiryCal)) {
|
||||
mDatePicker.setMinDate(mCreationCal.getTime().getTime()
|
||||
if (creationCal.before(mExpiryCal)) {
|
||||
mDatePicker.setMinDate(creationCal.getTime().getTime()
|
||||
+ DateUtils.DAY_IN_MILLIS);
|
||||
} else {
|
||||
// When created date isn't available
|
||||
// when creation date isn't available
|
||||
mDatePicker.setMinDate(mExpiryCal.getTime().getTime()
|
||||
+ DateUtils.DAY_IN_MILLIS);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user