diff options
Diffstat (limited to 'OpenKeychain/src/main/java')
8 files changed, 24 insertions, 17 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/input/CryptoInputParcel.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/input/CryptoInputParcel.java index e85b8d633..96f54dd2f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/input/CryptoInputParcel.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/input/CryptoInputParcel.java @@ -17,18 +17,17 @@ package org.sufficientlysecure.keychain.service.input; -import java.nio.ByteBuffer; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - import android.os.Parcel; import android.os.Parcelable; import org.sufficientlysecure.keychain.util.ParcelableProxy; import org.sufficientlysecure.keychain.util.Passphrase; +import java.nio.ByteBuffer; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + /** * This is a base class for the input of crypto operations. */ diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java index 007a67fbf..c5bfdbedf 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java @@ -51,6 +51,7 @@ import android.widget.TextView; import com.getbase.floatingactionbutton.FloatingActionButton; import com.getbase.floatingactionbutton.FloatingActionsMenu; + import se.emilsjolander.stickylistheaders.StickyListHeadersAdapter; import se.emilsjolander.stickylistheaders.StickyListHeadersListView; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/OrbotRequiredDialogActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/OrbotRequiredDialogActivity.java index 0e73ebf5d..b75baceb5 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/OrbotRequiredDialogActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/OrbotRequiredDialogActivity.java @@ -21,6 +21,7 @@ package org.sufficientlysecure.keychain.ui; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentActivity; + import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround; import org.sufficientlysecure.keychain.service.input.CryptoInputParcel; @@ -29,7 +30,8 @@ import org.sufficientlysecure.keychain.util.Preferences; import org.sufficientlysecure.keychain.util.orbot.OrbotHelper; /** - * Simply encapsulates a dialog. If orbot is not installed, it shows an install dialog, else a dialog to enable orbot. + * Simply encapsulates a dialog. If orbot is not installed, it shows an install dialog, else a + * dialog to enable orbot. */ public class OrbotRequiredDialogActivity extends FragmentActivity { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/UploadKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/UploadKeyActivity.java index fb47db872..703a85b0f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/UploadKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/UploadKeyActivity.java @@ -26,7 +26,6 @@ import android.view.View; import android.view.View.OnClickListener; import android.widget.ArrayAdapter; import android.widget.Spinner; -import android.widget.Toast; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CryptoOperationFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CryptoOperationFragment.java index 115f52d56..af664fc75 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CryptoOperationFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CryptoOperationFragment.java @@ -83,11 +83,11 @@ public abstract class CryptoOperationFragment<T extends Parcelable, S extends Op } /** - * * To be overriden by subclasses, if desired. Provides a way to access the method by the * same name in CryptoOperationHelper, if super.onCryptoOperationSuccess and * super.onCryptoOperationError are called at the start of the respective functions in the * subclass overriding them + * * @param result */ protected void onCryptoOperationResult(S result) { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CryptoOperationHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CryptoOperationHelper.java index 484c065c4..af8a84aca 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CryptoOperationHelper.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/base/CryptoOperationHelper.java @@ -28,8 +28,8 @@ import android.os.Messenger; import android.os.Parcelable; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; - import android.support.v4.app.FragmentManager; + import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.operations.results.InputPendingResult; @@ -53,11 +53,15 @@ import org.sufficientlysecure.keychain.util.Log; */ public class CryptoOperationHelper<T extends Parcelable, S extends OperationResult> { - public interface Callback <T extends Parcelable, S extends OperationResult> { + public interface Callback<T extends Parcelable, S extends OperationResult> { T createOperationInput(); + void onCryptoOperationSuccess(S result); + void onCryptoOperationCancelled(); + void onCryptoOperationError(S result); + boolean onCryptoSetProgress(String msg, int progress, int max); } @@ -124,6 +128,7 @@ public class CryptoOperationHelper<T extends Parcelable, S extends OperationResu Activity activity = mUseFragment ? mFragment.getActivity() : mActivity; switch (requiredInput.mType) { + // TODO: Verify that all started activities add to cryptoInputParcel if necessary (like OrbotRequiredDialogActivity) // don't forget to set mRequestedCode! case NFC_MOVE_KEY_TO_CARD: case NFC_DECRYPT: @@ -215,12 +220,10 @@ public class CryptoOperationHelper<T extends Parcelable, S extends OperationResu } case REQUEST_CODE_ENABLE_ORBOT: { - Log.e("PHILIP", "request rec"); if (resultCode == Activity.RESULT_OK && data != null) { CryptoInputParcel cryptoInput = data.getParcelableExtra( OrbotRequiredDialogActivity.RESULT_CRYPTO_INPUT); - Log.e("PHILIP", "initiating next op"); cryptoOperation(cryptoInput); return true; } @@ -294,7 +297,7 @@ public class CryptoOperationHelper<T extends Parcelable, S extends OperationResu @Override protected void onSetProgress(String msg, int progress, int max) { // allow handling of progress in fragment, or delegate upwards - if ( ! mCallback.onCryptoSetProgress(msg, progress, max)) { + if (!mCallback.onCryptoSetProgress(msg, progress, max)) { super.onSetProgress(msg, progress, max); } } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ParcelableProxy.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ParcelableProxy.java index 661650824..b00b03ec7 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ParcelableProxy.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ParcelableProxy.java @@ -34,7 +34,9 @@ public class ParcelableProxy implements Parcelable { public ParcelableProxy(String hostName, int port, Proxy.Type type) { mProxyHost = hostName; - if (hostName == null) return; // represents a null proxy + if (hostName == null) { + return; // represents a null proxy + } mProxyPort = port; @@ -46,7 +48,9 @@ public class ParcelableProxy implements Parcelable { } public Proxy getProxy() { - if (mProxyHost == null) return null; + if (mProxyHost == null) { + return null; + } return new Proxy(mProxyType, new InetSocketAddress(mProxyHost, mProxyPort)); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/orbot/OrbotHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/orbot/OrbotHelper.java index 6a78b34f5..b73d90f9b 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/orbot/OrbotHelper.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/orbot/OrbotHelper.java @@ -59,7 +59,6 @@ import android.support.v4.app.DialogFragment; import android.support.v4.app.FragmentActivity; import org.sufficientlysecure.keychain.R; -import org.sufficientlysecure.keychain.service.ConsolidateInputParcel; import org.sufficientlysecure.keychain.ui.dialog.SupportInstallDialogFragment; import org.sufficientlysecure.keychain.ui.dialog.OrbotStartDialogFragment; import org.sufficientlysecure.keychain.ui.dialog.PreferenceInstallDialogFragment; |