diff --git a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmService.java b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmService.java index 3c2f715..00378d9 100644 --- a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmService.java +++ b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmService.java @@ -1,13 +1,9 @@ package za.org.treehouse.hypoalarm; -import android.app.ActivityManager; -import android.app.AlarmManager; -import android.app.PendingIntent; import android.app.Service; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; -import android.os.Build; import android.os.Handler; import android.os.IBinder; import android.os.PowerManager; @@ -23,12 +19,12 @@ public class AlarmService extends Service { private static PowerManager.WakeLock wl; private static Intent alarmServiceIntent, alertActivityIntent, notifyIntent; private static Boolean alarmStarted = false; - public static volatile String alarmStatus; // Register ALARM_DISMISSED and its brethren here public static final String ALARM_RUNNING = "ALARM_RUNNING"; public static final String ALARM_DISMISSED = "ALARM_DISMISSED"; public static final String ALARM_IGNORED = "ALARM_IGNORED"; public static final String ALARM_SNOOZED = "ALARM_SNOOZED"; public static final String ALARM_SNOOZE_RUNNING = "ALARM_SNOOZE_RUNNING"; + public static volatile String alarmStatus = ALARM_DISMISSED; // Register ALARM_DISMISSED and its brethren here public static long graceEndTime; @Override diff --git a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/CancelAlarmReceiver.java b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/CancelAlarmReceiver.java index 112d739..a9a6d93 100644 --- a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/CancelAlarmReceiver.java +++ b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/CancelAlarmReceiver.java @@ -1,12 +1,9 @@ package za.org.treehouse.hypoalarm; -import android.app.AlarmManager; -import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; -import android.os.Build; import android.preference.PreferenceManager; import android.util.Log; import android.widget.Toast; diff --git a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/CancelGraceReceiver.java b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/CancelGraceReceiver.java index 0963b21..a0a8c8a 100644 --- a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/CancelGraceReceiver.java +++ b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/CancelGraceReceiver.java @@ -1,7 +1,5 @@ package za.org.treehouse.hypoalarm; -import android.app.AlarmManager; -import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; diff --git a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/MainActivity.java b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/MainActivity.java index 7ef5a0d..64416e4 100644 --- a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/MainActivity.java +++ b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/MainActivity.java @@ -712,15 +712,6 @@ public class MainActivity extends ActionBarActivity { return remMinutes + minStr; } - // TODO remove this function? - public static Calendar minutesAgo(int minutes) { - // Negate number to get minutes in the past. - minutes = minutes * -1; - Calendar cal = Calendar.getInstance(); - cal.add(Calendar.MINUTE, minutes); - return cal; - } - public static String debugDate(Calendar cal) { SimpleDateFormat print = new SimpleDateFormat("dd-MM-yyyy HH:mm:ssZ"); return print.format(cal.getTime());