diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-10-16 15:30:06 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-10-16 15:30:06 +0200 |
commit | 8f565296b9503b210cd8edb8cb9ea42a3055c3c6 (patch) | |
tree | 55bfb9424a16e9a3fa11c6362ca761ab16bfd3d3 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateYubiKeyImportResetFragment.java | |
parent | 930db9061efbed0cc3fd8955a15f3aba84eb53d8 (diff) | |
download | open-keychain-8f565296b9503b210cd8edb8cb9ea42a3055c3c6.tar.gz open-keychain-8f565296b9503b210cd8edb8cb9ea42a3055c3c6.tar.bz2 open-keychain-8f565296b9503b210cd8edb8cb9ea42a3055c3c6.zip |
Integrate yubikey reset method
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateYubiKeyImportResetFragment.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateYubiKeyImportResetFragment.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateYubiKeyImportResetFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateYubiKeyImportResetFragment.java index 3529f98d8..0a2d52617 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateYubiKeyImportResetFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateYubiKeyImportResetFragment.java @@ -25,6 +25,7 @@ import java.util.ArrayList; import android.app.Activity; import android.content.Intent; import android.os.Bundle; +import android.os.Parcelable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; @@ -39,6 +40,8 @@ import org.sufficientlysecure.keychain.keyimport.ParcelableKeyRing; import org.sufficientlysecure.keychain.operations.results.ImportKeyResult; import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings; import org.sufficientlysecure.keychain.service.ImportKeyringParcel; +import org.sufficientlysecure.keychain.service.input.CryptoInputParcel; +import org.sufficientlysecure.keychain.service.input.RequiredInputParcel; import org.sufficientlysecure.keychain.ui.CreateKeyActivity.FragAction; import org.sufficientlysecure.keychain.ui.CreateKeyActivity.NfcListenerFragment; import org.sufficientlysecure.keychain.ui.base.QueueingCryptoOperationFragment; @@ -50,6 +53,8 @@ public class CreateYubiKeyImportResetFragment extends QueueingCryptoOperationFragment<ImportKeyringParcel, ImportKeyResult> implements NfcListenerFragment { + private static final int REQUEST_CODE_RESET = 0x00005001; + private static final String ARG_FINGERPRINTS = "fingerprint"; public static final String ARG_AID = "aid"; public static final String ARG_USER_ID = "user_ids"; @@ -230,7 +235,22 @@ public class CreateYubiKeyImportResetFragment } public void resetCard() { + Intent intent = new Intent(getActivity(), NfcOperationActivity.class); + intent.putExtra(NfcOperationActivity.EXTRA_SERVICE_INTENT, (Parcelable[]) null); + RequiredInputParcel resetP = RequiredInputParcel.createNfcReset(); + intent.putExtra(NfcOperationActivity.EXTRA_REQUIRED_INPUT, resetP); + intent.putExtra(NfcOperationActivity.EXTRA_CRYPTO_INPUT, new CryptoInputParcel()); + startActivityForResult(intent, REQUEST_CODE_RESET); + } + + @Override + public void onActivityResult(int requestCode, int resultCode, Intent data) { + if (requestCode == REQUEST_CODE_RESET && resultCode == Activity.RESULT_OK) { + mCreateKeyActivity.loadFragment(null, FragAction.TO_LEFT); + return; + } + super.onActivityResult(requestCode, resultCode, data); } @Override |