From b893ab6c7260204dcff228a16527edc787810206 Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 25 Mar 2014 20:43:50 +0200 Subject: [PATCH] Some small tweaks. --- .../treehouse/hypoalarm/AlarmAlertActivity.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmAlertActivity.java b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmAlertActivity.java index 0128854..a2be94c 100644 --- a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmAlertActivity.java +++ b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmAlertActivity.java @@ -19,14 +19,18 @@ import java.util.TimerTask; // TODO See GlowPad. +// TODO sound audible alarm -- see AlarmKlaxon.java +// TODO Lower alarm volume if in phone call (and detect phone call!) +// TODO set another alarm for the next half-hour (or grace_period / 2)? + public class AlarmAlertActivity extends Activity { // TODO correct life - static int ALERT_LIFE = 1000*10;//1000*60*2; // 2 minutes - private Timer timer; - private PowerManager.WakeLock fullWl; - private AlarmManager graceManager; - private PendingIntent gracePendingIntent; - private Vibrator vibrator; + private static final int ALERT_LIFE = 1000*10;//1000*60*2; // 2 minutes + private static final Timer timer = new Timer(); + private static PowerManager.WakeLock fullWl; + private static AlarmManager graceManager; + private static PendingIntent gracePendingIntent; + private static Vibrator vibrator; @Override protected void onCreate(Bundle savedInstanceState) { @@ -42,7 +46,6 @@ public class AlarmAlertActivity extends Activity { WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON ); // Turn off the alert activity, and switch to a notification - timer = new Timer(); timer.schedule(new TimerTask() { public void run() { // Switch to notification