source: trunk/hiptop/pester/net/sabi/pester/AlarmAlertWindow.java@ 299

Last change on this file since 299 was 298, checked in by Nicholas Riley, 18 years ago

Fix problems with alert sound playing: stop if user hits any key; don't auto-enter keyguard while sound is playing.

File size: 658 bytes
Line 
1package net.sabi.pester;
2
3import danger.app.Event;
4import danger.ui.AlertWindow;
5import danger.util.DEBUG;
6
7public class AlarmAlertWindow extends AlertWindow {
8 boolean mShowTonePlaying;
9
10 protected void startShowTone() {
11 super.startShowTone();
12 mShowTonePlaying = true;
13 }
14
15 protected void stopShowTone() {
16 super.stopShowTone();
17 mShowTonePlaying = false;
18 }
19
20 public boolean blocksKeyGuard() {
21 return mShowTonePlaying;
22 }
23
24 public boolean eventRawKeyDown(int keycode, Event event) {
25 // this also covers widgets, dirpad, etc.
26 if (mShowTonePlaying)
27 stopShowTone();
28 return super.eventRawKeyDown(keycode, event);
29 }
30}
Note: See TracBrowser for help on using the repository browser.