// Path: secu3droid/src/org/secu3/android/api/io/Secu3Manager.java
// public enum SECU3_TASK {
// 	SECU3_NONE, SECU3_READ_SENSORS, SECU3_RAW_SENSORS, SECU3_READ_PARAMS, SECU3_READ_ERRORS, SECU3_READ_FW_INFO, SECU3_START_SENSOR_LOGGING, SECU3_STOP_SENSOR_LOGGING, SECU3_START_RAW_LOGGING, SECU3_STOP_RAW_LOGGING, SECU3_SET_LOG_MARKER_1, SECU3_SET_LOG_MARKER_2, SECU3_SET_LOG_MARKER_3
// }


import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.util.Log;
import org.secu3.android.R;
import org.secu3.android.api.io.Secu3Manager.SECU3_TASK;
import android.app.NotificationManager;
import android.app.Service;
							stopSelf();
						}
					} else {
						stopSelf();
					}
				} else {
					secu3Notification.toast(R.string.msg_service_already_started);
					sendBroadcast(intent);
				}
			} else {
				secu3Notification.toast(R.string.msg_bluetooth_unsupported);
				stopSelf();
			}
		} else if (ACTION_SECU3_SERVICE_STOP.equals(intent.getAction())){
			Log.d(LOG_TAG, "Stopping service");
			secu3Notification.notificationManager.cancelAll();
			Secu3Manager manager = secu3Manager;
			secu3Manager  = null;
			if (manager != null){
				if (manager.getDisableReason() != 0){
					secu3Notification.notifyServiceStopped(manager.getDisableReason());
					secu3Notification.toast(getString(R.string.msg_service_stopped_by_problem, getString(manager.getDisableReason())));				
				} else {
					secu3Notification.toast(R.string.msg_service_stopped);
				}
				manager.disable();
			}			
			stopSelf();
			System.exit(0);			
		} else if (ACTION_SECU3_SERVICE_SET_TASK.equals(intent.getAction())) {
// Path: secu3droid/src/org/secu3/android/api/io/Secu3Manager.java
// public enum SECU3_TASK {
// 	SECU3_NONE, SECU3_READ_SENSORS, SECU3_RAW_SENSORS, SECU3_READ_PARAMS, SECU3_READ_ERRORS, SECU3_READ_FW_INFO, SECU3_START_SENSOR_LOGGING, SECU3_STOP_SENSOR_LOGGING, SECU3_START_RAW_LOGGING, SECU3_STOP_RAW_LOGGING, SECU3_SET_LOG_MARKER_1, SECU3_SET_LOG_MARKER_2, SECU3_SET_LOG_MARKER_3
// }


// Path: secu3droid/src/org/secu3/android/api/io/Secu3Service.java
import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.util.Log;
import org.secu3.android.R;
import org.secu3.android.api.io.Secu3Manager.SECU3_TASK;
import android.app.NotificationManager;
import android.app.Service;

							stopSelf();
						}
					} else {
						stopSelf();
					}
				} else {
					secu3Notification.toast(R.string.msg_service_already_started);
					sendBroadcast(intent);
				}
			} else {
				secu3Notification.toast(R.string.msg_bluetooth_unsupported);
				stopSelf();
			}
		} else if (ACTION_SECU3_SERVICE_STOP.equals(intent.getAction())){
			Log.d(LOG_TAG, "Stopping service");
			secu3Notification.notificationManager.cancelAll();
			Secu3Manager manager = secu3Manager;
			secu3Manager  = null;
			if (manager != null){
				if (manager.getDisableReason() != 0){
					secu3Notification.notifyServiceStopped(manager.getDisableReason());
					secu3Notification.toast(getString(R.string.msg_service_stopped_by_problem, getString(manager.getDisableReason())));				
				} else {
					secu3Notification.toast(R.string.msg_service_stopped);
				}
				manager.disable();
			}			
			stopSelf();
			System.exit(0);			
		} else if (ACTION_SECU3_SERVICE_SET_TASK.equals(intent.getAction())) {
			SECU3_TASK task = SECU3_TASK.values()[intent.getIntExtra(ACTION_SECU3_SERVICE_SET_TASK_PARAM, SECU3_TASK.SECU3_NONE.ordinal())];