// Path: src/com/martinborjesson/o2xtouchlednotifications/services/AccessibilityService.java
// static public class NotificationEvent {
// 	public long time = 0;
// 	public String packageName = null;
// 	public String label = null;
// 	public boolean lights = false;
// }
// 
// Path: src/com/martinborjesson/o2xtouchlednotifications/ui/preference/SeekBarPreference.java
// static public interface OnNoChangeListener {
// 	public void onNoChange(Preference preference);
// }


import java.io.*;
import java.util.*;
import android.accounts.*;
import android.app.*;
import android.content.*;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnClickListener;
import android.content.DialogInterface.OnDismissListener;
import android.content.DialogInterface.OnMultiChoiceClickListener;
import android.content.SharedPreferences.Editor;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.content.pm.*;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.*;
import android.graphics.*;
import android.media.*;
import android.net.*;
import android.os.*;
import android.preference.*;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener;
import android.provider.*;
import android.provider.Settings.SettingNotFoundException;
import android.text.format.*;
import android.text.method.*;
import android.util.*;
import android.widget.*;
import android.widget.SeekBar.OnSeekBarChangeListener;
import com.martinborjesson.o2xtouchlednotifications.*;
import com.martinborjesson.o2xtouchlednotifications.notifications.*;
import com.martinborjesson.o2xtouchlednotifications.services.*;
import com.martinborjesson.o2xtouchlednotifications.services.AccessibilityService.NotificationEvent;
import com.martinborjesson.o2xtouchlednotifications.touchled.*;
import com.martinborjesson.o2xtouchlednotifications.touchled.devices.*;
import com.martinborjesson.o2xtouchlednotifications.ui.preference.*;
import com.martinborjesson.o2xtouchlednotifications.ui.preference.SeekBarPreference.OnNoChangeListener;
import com.martinborjesson.o2xtouchlednotifications.utils.*;
//				@Override
//				public boolean onPreferenceClick(Preference preference) {
//					AlertDialog.Builder builder = new AlertDialog.Builder(MainPreferences.this);
//					builder.setTitle("Testing pulse...");
//					builder.setNegativeButton(android.R.string.cancel, new OnClickListener() {
//						
//						@Override
//						public void onClick(DialogInterface dialog, int which) {
//							BootReceiver.stopPulse(MainPreferences.this);
//						}
//					});
//					testPulseDialog = builder.create();
//					testPulseDialog.show();
//
//			    	BootReceiver.startService(MainPreferences.this, null);
//
//					return true;
//				}
//			});
        }
        { // log all notifications
        	Preference p = findPreference("buttonListNotificationsFromActivities");
        	p.setOnPreferenceClickListener(new OnPreferenceClickListener() {
				
				@Override
				public boolean onPreferenceClick(Preference preference) {
					Context context = MainPreferences.this;
					AlertDialog.Builder builder = new AlertDialog.Builder(context);
					builder.setTitle(R.string.dialog_title_logged_notifications);
					builder.setPositiveButton(android.R.string.ok, null);
// Path: src/com/martinborjesson/o2xtouchlednotifications/services/AccessibilityService.java
// static public class NotificationEvent {
// 	public long time = 0;
// 	public String packageName = null;
// 	public String label = null;
// 	public boolean lights = false;
// }
// 
// Path: src/com/martinborjesson/o2xtouchlednotifications/ui/preference/SeekBarPreference.java
// static public interface OnNoChangeListener {
// 	public void onNoChange(Preference preference);
// }


// Path: src/com/martinborjesson/o2xtouchlednotifications/ui/MainPreferences.java
import java.io.*;
import java.util.*;
import android.accounts.*;
import android.app.*;
import android.content.*;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnClickListener;
import android.content.DialogInterface.OnDismissListener;
import android.content.DialogInterface.OnMultiChoiceClickListener;
import android.content.SharedPreferences.Editor;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.content.pm.*;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.*;
import android.graphics.*;
import android.media.*;
import android.net.*;
import android.os.*;
import android.preference.*;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener;
import android.provider.*;
import android.provider.Settings.SettingNotFoundException;
import android.text.format.*;
import android.text.method.*;
import android.util.*;
import android.widget.*;
import android.widget.SeekBar.OnSeekBarChangeListener;
import com.martinborjesson.o2xtouchlednotifications.*;
import com.martinborjesson.o2xtouchlednotifications.notifications.*;
import com.martinborjesson.o2xtouchlednotifications.services.*;
import com.martinborjesson.o2xtouchlednotifications.services.AccessibilityService.NotificationEvent;
import com.martinborjesson.o2xtouchlednotifications.touchled.*;
import com.martinborjesson.o2xtouchlednotifications.touchled.devices.*;
import com.martinborjesson.o2xtouchlednotifications.ui.preference.*;
import com.martinborjesson.o2xtouchlednotifications.ui.preference.SeekBarPreference.OnNoChangeListener;
import com.martinborjesson.o2xtouchlednotifications.utils.*;

//				@Override
//				public boolean onPreferenceClick(Preference preference) {
//					AlertDialog.Builder builder = new AlertDialog.Builder(MainPreferences.this);
//					builder.setTitle("Testing pulse...");
//					builder.setNegativeButton(android.R.string.cancel, new OnClickListener() {
//						
//						@Override
//						public void onClick(DialogInterface dialog, int which) {
//							BootReceiver.stopPulse(MainPreferences.this);
//						}
//					});
//					testPulseDialog = builder.create();
//					testPulseDialog.show();
//
//			    	BootReceiver.startService(MainPreferences.this, null);
//
//					return true;
//				}
//			});
        }
        { // log all notifications
        	Preference p = findPreference("buttonListNotificationsFromActivities");
        	p.setOnPreferenceClickListener(new OnPreferenceClickListener() {
				
				@Override
				public boolean onPreferenceClick(Preference preference) {
					Context context = MainPreferences.this;
					AlertDialog.Builder builder = new AlertDialog.Builder(context);
					builder.setTitle(R.string.dialog_title_logged_notifications);
					builder.setPositiveButton(android.R.string.ok, null);
					List<NotificationEvent> events = AccessibilityService.getNotificationEvents();