From 14a08361e52bcd8bd26b9b2b2b9690276b40ed42 Mon Sep 17 00:00:00 2001 From: Adithya Abraham Philip Date: Thu, 28 May 2015 17:02:34 +0530 Subject: merged services --- .../keychain/ui/dialog/ProgressDialogFragment.java | 33 ++++------------------ 1 file changed, 5 insertions(+), 28 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/ProgressDialogFragment.java') 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); -- cgit v1.2.3