diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-07-02 17:39:03 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-07-02 17:39:03 +0200 |
commit | 9dac8ddbac60997e16b7cb1a4fc9bad71cc0ab87 (patch) | |
tree | 48f849e2d1820c41943f8da54db06a1357265be2 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui | |
parent | 195508ed92434197d0d6ab2d3ef6e0b4bd0780b6 (diff) | |
download | open-keychain-9dac8ddbac60997e16b7cb1a4fc9bad71cc0ab87.tar.gz open-keychain-9dac8ddbac60997e16b7cb1a4fc9bad71cc0ab87.tar.bz2 open-keychain-9dac8ddbac60997e16b7cb1a4fc9bad71cc0ab87.zip |
Disable move to card from edit screen
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui')
2 files changed, 45 insertions, 39 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java index 1363d44f2..b9f961d70 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyFragment.java @@ -437,44 +437,50 @@ public class EditKeyFragment extends CryptoOperationFragment<SaveKeyringParcel, } break; } - case EditSubkeyDialogFragment.MESSAGE_KEYTOCARD: { - Activity activity = EditKeyFragment.this.getActivity(); - SecretKeyType secretKeyType = mSubkeysAdapter.getSecretKeyType(position); - if (secretKeyType == SecretKeyType.DIVERT_TO_CARD || - secretKeyType == SecretKeyType.GNU_DUMMY) { - Notify.create(activity, R.string.edit_key_error_bad_nfc_stripped, Notify.Style.ERROR) - .show((ViewGroup) activity.findViewById(R.id.import_snackbar)); - break; - } - int algorithm = mSubkeysAdapter.getAlgorithm(position); - // these are the PGP constants for RSA_GENERAL, RSA_ENCRYPT and RSA_SIGN - if (algorithm != 1 && algorithm != 2 && algorithm != 3) { - Notify.create(activity, R.string.edit_key_error_bad_nfc_algo, Notify.Style.ERROR) - .show((ViewGroup) activity.findViewById(R.id.import_snackbar)); - break; - } - if (mSubkeysAdapter.getKeySize(position) != 2048) { - Notify.create(activity, R.string.edit_key_error_bad_nfc_size, Notify.Style.ERROR) - .show((ViewGroup) activity.findViewById(R.id.import_snackbar)); - break; - } - - - SubkeyChange change; - change = mSaveKeyringParcel.getSubkeyChange(keyId); - if (change == null) { - mSaveKeyringParcel.mChangeSubKeys.add( - new SubkeyChange(keyId, false, true) - ); - break; - } - // toggle - change.mMoveKeyToCard = !change.mMoveKeyToCard; - if (change.mMoveKeyToCard && change.mDummyStrip) { - // User had chosen to strip key, but now wants to divert it. - change.mDummyStrip = false; - } + case EditSubkeyDialogFragment.MESSAGE_MOVE_KEY_TO_CARD: { + // TODO: enable later when Admin PIN handling is resolved + Notify.create(getActivity(), + "This feature will be available in an upcoming OpenKeychain version.", + Notify.Style.WARN).show(); break; + +// Activity activity = EditKeyFragment.this.getActivity(); +// SecretKeyType secretKeyType = mSubkeysAdapter.getSecretKeyType(position); +// if (secretKeyType == SecretKeyType.DIVERT_TO_CARD || +// secretKeyType == SecretKeyType.GNU_DUMMY) { +// Notify.create(activity, R.string.edit_key_error_bad_nfc_stripped, Notify.Style.ERROR) +// .show((ViewGroup) activity.findViewById(R.id.import_snackbar)); +// break; +// } +// int algorithm = mSubkeysAdapter.getAlgorithm(position); +// // these are the PGP constants for RSA_GENERAL, RSA_ENCRYPT and RSA_SIGN +// if (algorithm != 1 && algorithm != 2 && algorithm != 3) { +// Notify.create(activity, R.string.edit_key_error_bad_nfc_algo, Notify.Style.ERROR) +// .show((ViewGroup) activity.findViewById(R.id.import_snackbar)); +// break; +// } +// if (mSubkeysAdapter.getKeySize(position) != 2048) { +// Notify.create(activity, R.string.edit_key_error_bad_nfc_size, Notify.Style.ERROR) +// .show((ViewGroup) activity.findViewById(R.id.import_snackbar)); +// break; +// } +// +// +// SubkeyChange change; +// change = mSaveKeyringParcel.getSubkeyChange(keyId); +// if (change == null) { +// mSaveKeyringParcel.mChangeSubKeys.add( +// new SubkeyChange(keyId, false, true) +// ); +// break; +// } +// // toggle +// change.mMoveKeyToCard = !change.mMoveKeyToCard; +// if (change.mMoveKeyToCard && change.mDummyStrip) { +// // User had chosen to strip key, but now wants to divert it. +// change.mDummyStrip = false; +// } +// break; } } getLoaderManager().getLoader(LOADER_ID_SUBKEYS).forceLoad(); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyDialogFragment.java index eafa129f0..b51648740 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyDialogFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyDialogFragment.java @@ -35,7 +35,7 @@ public class EditSubkeyDialogFragment extends DialogFragment { public static final int MESSAGE_CHANGE_EXPIRY = 1; public static final int MESSAGE_REVOKE = 2; public static final int MESSAGE_STRIP = 3; - public static final int MESSAGE_KEYTOCARD = 4; + public static final int MESSAGE_MOVE_KEY_TO_CARD = 4; private Messenger mMessenger; @@ -78,7 +78,7 @@ public class EditSubkeyDialogFragment extends DialogFragment { sendMessageToHandler(MESSAGE_STRIP, null); break; case 3: - sendMessageToHandler(MESSAGE_KEYTOCARD, null); + sendMessageToHandler(MESSAGE_MOVE_KEY_TO_CARD, null); break; default: break; |