Some small tweaks.

This commit is contained in:
Timothy Allen 2014-03-25 20:43:50 +02:00
parent 08f8c79dd3
commit b893ab6c72

View File

@ -19,14 +19,18 @@ import java.util.TimerTask;
// TODO See GlowPad. // 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 { public class AlarmAlertActivity extends Activity {
// TODO correct life // TODO correct life
static int ALERT_LIFE = 1000*10;//1000*60*2; // 2 minutes private static final int ALERT_LIFE = 1000*10;//1000*60*2; // 2 minutes
private Timer timer; private static final Timer timer = new Timer();
private PowerManager.WakeLock fullWl; private static PowerManager.WakeLock fullWl;
private AlarmManager graceManager; private static AlarmManager graceManager;
private PendingIntent gracePendingIntent; private static PendingIntent gracePendingIntent;
private Vibrator vibrator; private static Vibrator vibrator;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -42,7 +46,6 @@ public class AlarmAlertActivity extends Activity {
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON ); WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON );
// Turn off the alert activity, and switch to a notification // Turn off the alert activity, and switch to a notification
timer = new Timer();
timer.schedule(new TimerTask() { timer.schedule(new TimerTask() {
public void run() { public void run() {
// Switch to notification // Switch to notification