aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java
diff options
context:
space:
mode:
authorAdithya Abraham Philip <adithyaphilip@gmail.com>2015-05-28 17:02:34 +0530
committerAdithya Abraham Philip <adithyaphilip@gmail.com>2015-06-01 17:41:44 +0530
commit14a08361e52bcd8bd26b9b2b2b9690276b40ed42 (patch)
tree596f89e6a9e432568fa212437e64a5462cbed0ca /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java
parentb356df900fb5ee3b9fc981f0beec73b48b529155 (diff)
downloadopen-keychain-14a08361e52bcd8bd26b9b2b2b9690276b40ed42.tar.gz
open-keychain-14a08361e52bcd8bd26b9b2b2b9690276b40ed42.tar.bz2
open-keychain-14a08361e52bcd8bd26b9b2b2b9690276b40ed42.zip
merged services
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java33
1 files changed, 5 insertions, 28 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java
index 562517c12..6dfa77d3f 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java
@@ -33,25 +33,18 @@ import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
-import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
-import org.sufficientlysecure.keychain.service.CloudImportService;
import org.sufficientlysecure.keychain.service.KeychainIntentService;
-import org.sufficientlysecure.keychain.util.Log;
+/**
+ * meant to be used
+ */
public class ProgressDialogFragment extends DialogFragment {
private static final String ARG_MESSAGE = "message";
private static final String ARG_STYLE = "style";
private static final String ARG_CANCELABLE = "cancelable";
private static final String ARG_SERVICE_TYPE = "service_class";
- public enum ServiceType {
- KEYCHAIN_INTENT,
- CLOUD_IMPORT
- }
-
- ServiceType mServiceType;
-
boolean mCanCancel = false, mPreventCancel = false, mIsCancelled = false;
/**
@@ -59,16 +52,13 @@ public class ProgressDialogFragment extends DialogFragment {
* @param message the message to be displayed initially above the progress bar
* @param style the progress bar style, as defined in ProgressDialog (horizontal or spinner)
* @param cancelable should we let the user cancel this operation
- * @param serviceType which Service this progress dialog is meant for
*/
- public static ProgressDialogFragment newInstance(String message, int style, boolean cancelable,
- ServiceType serviceType) {
+ public static ProgressDialogFragment newInstance(String message, int style, boolean cancelable) {
ProgressDialogFragment frag = new ProgressDialogFragment();
Bundle args = new Bundle();
args.putString(ARG_MESSAGE, message);
args.putInt(ARG_STYLE, style);
args.putBoolean(ARG_CANCELABLE, cancelable);
- args.putSerializable(ARG_SERVICE_TYPE, serviceType);
frag.setArguments(args);
@@ -121,7 +111,6 @@ public class ProgressDialogFragment extends DialogFragment {
String message = getArguments().getString(ARG_MESSAGE);
int style = getArguments().getInt(ARG_STYLE);
mCanCancel = getArguments().getBoolean(ARG_CANCELABLE);
- mServiceType = (ServiceType) getArguments().getSerializable(ARG_SERVICE_TYPE);
dialog.setMessage(message);
dialog.setProgressStyle(style);
@@ -191,19 +180,7 @@ public class ProgressDialogFragment extends DialogFragment {
// send a cancel message. note that this message will be handled by
// KeychainIntentService.onStartCommand, which runs in this thread,
// not the service one, and will not queue up a command.
- Intent serviceIntent = null;
-
- switch (mServiceType) {
- case CLOUD_IMPORT:
- serviceIntent = new Intent(getActivity(), CloudImportService.class);
- break;
- case KEYCHAIN_INTENT:
- serviceIntent = new Intent(getActivity(), KeychainIntentService.class);
- break;
- default:
- //should never happen, unless we forget to include a ServiceType enum case
- Log.e(Constants.TAG, "Unrecognized ServiceType at ProgressDialogFragment");
- }
+ Intent serviceIntent = new Intent(getActivity(), KeychainIntentService.class);
serviceIntent.setAction(KeychainIntentService.ACTION_CANCEL);
getActivity().startService(serviceIntent);