Loading AndroidManifest.xml +2 −1 Original line number Diff line number Diff line Loading @@ -191,7 +191,8 @@ android:theme="@style/AlarmAlertFullScreenTheme" android:launchMode="singleInstance" showOnLockScreen="true" android:taskAffinity=""/> android:taskAffinity="" android:configChanges="orientation|screenSize|keyboardHidden|keyboard|navigation"/> <service android:name="TimerRingService" android:exported="false" Loading src/com/android/deskclock/AlarmAlertFullScreen.java +14 −10 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ public class AlarmAlertFullScreen extends Activity implements GlowPadView.OnTrig private static final long PING_AUTO_REPEAT_DELAY_MSEC = 1200; private boolean mPingEnabled = true; boolean mCallSnoozeonStop = true; // Receives the ALARM_KILLED action from the AlarmKlaxon, // and also ALARM_SNOOZE_ACTION / ALARM_DISMISS_ACTION from other applications Loading Loading @@ -185,6 +186,7 @@ public class AlarmAlertFullScreen extends Activity implements GlowPadView.OnTrig if (LOG) { Log.v("AlarmAlertFullScreen - snooze"); } mCallSnoozeonStop = false; final String snooze = PreferenceManager.getDefaultSharedPreferences(this) Loading Loading @@ -249,6 +251,7 @@ public class AlarmAlertFullScreen extends Activity implements GlowPadView.OnTrig if (LOG) { Log.v("AlarmAlertFullScreen - dismiss"); } mCallSnoozeonStop = false; Log.i(killed ? "Alarm killed" : "Alarm dismissed by user"); // The service told us that the alarm has been killed, do not modify Loading Loading @@ -300,6 +303,17 @@ public class AlarmAlertFullScreen extends Activity implements GlowPadView.OnTrig } } @Override protected void onStop() { if (LOG) { Log.v("AlarmAlertFullScreen - onStop snooze=" + mCallSnoozeonStop); } if (mCallSnoozeonStop) { snooze(); } super.onStop(); } @Override public void onDestroy() { super.onDestroy(); Loading Loading @@ -344,16 +358,6 @@ public class AlarmAlertFullScreen extends Activity implements GlowPadView.OnTrig return super.dispatchKeyEvent(event); } @Override public void onBackPressed() { // Don't allow back to dismiss. This method is overriden by AlarmAlert // so that the dialog is dismissed. if (LOG) { Log.v("AlarmAlertFullScreen - onBackPressed"); } return; } @Override public void onGrabbed(View v, int handle) { Loading src/com/android/deskclock/AlarmKlaxon.java +2 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import android.media.MediaPlayer; import android.media.MediaPlayer.OnErrorListener; import android.media.RingtoneManager; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Message; Loading Loading @@ -56,6 +55,7 @@ public class AlarmKlaxon extends Service { // Internal messages private static final int KILLER = 1000; private Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { switch (msg.what) { case KILLER: Loading Loading @@ -174,6 +174,7 @@ public class AlarmKlaxon extends Service { // RingtoneManager. mMediaPlayer = new MediaPlayer(); mMediaPlayer.setOnErrorListener(new OnErrorListener() { @Override public boolean onError(MediaPlayer mp, int what, int extra) { Log.e("Error occurred while playing audio."); mp.stop(); Loading src/com/android/deskclock/DeskClock.java +1 −8 Original line number Diff line number Diff line Loading @@ -38,17 +38,12 @@ import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import android.view.animation.AnimationUtils; import android.view.animation.ScaleAnimation; import android.view.animation.Transformation; import android.view.animation.TranslateAnimation; import android.widget.LinearLayout.LayoutParams; import android.widget.PopupMenu; import android.widget.TextView; import android.widget.Toast; import com.android.deskclock.stopwatch.StopwatchFragment; import com.android.deskclock.stopwatch.StopwatchService; Loading Loading @@ -258,9 +253,7 @@ public class DeskClock extends Activity implements LabelDialogFragment.TimerLabe SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(Timers.NOTIF_APP_OPEN, false); editor.apply(); Intent timerIntent = new Intent(); timerIntent.setAction(Timers.NOTIF_IN_USE_SHOW); sendBroadcast(timerIntent); Utils.showInUseNotifications(this); super.onPause(); } Loading src/com/android/deskclock/TimerRingService.java +1 −2 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.media.MediaPlayer.OnErrorListener; import android.media.RingtoneManager; import android.net.Uri; import android.os.IBinder; import android.os.Vibrator; import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; Loading Loading @@ -105,7 +104,7 @@ public class TimerRingService extends Service { } if (Log.LOGV) { Log.v("TimerRingSErvice.play()"); Log.v("TimerRingService.play()"); } // TODO: Reuse mMediaPlayer instead of creating a new one and/or use Loading Loading
AndroidManifest.xml +2 −1 Original line number Diff line number Diff line Loading @@ -191,7 +191,8 @@ android:theme="@style/AlarmAlertFullScreenTheme" android:launchMode="singleInstance" showOnLockScreen="true" android:taskAffinity=""/> android:taskAffinity="" android:configChanges="orientation|screenSize|keyboardHidden|keyboard|navigation"/> <service android:name="TimerRingService" android:exported="false" Loading
src/com/android/deskclock/AlarmAlertFullScreen.java +14 −10 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ public class AlarmAlertFullScreen extends Activity implements GlowPadView.OnTrig private static final long PING_AUTO_REPEAT_DELAY_MSEC = 1200; private boolean mPingEnabled = true; boolean mCallSnoozeonStop = true; // Receives the ALARM_KILLED action from the AlarmKlaxon, // and also ALARM_SNOOZE_ACTION / ALARM_DISMISS_ACTION from other applications Loading Loading @@ -185,6 +186,7 @@ public class AlarmAlertFullScreen extends Activity implements GlowPadView.OnTrig if (LOG) { Log.v("AlarmAlertFullScreen - snooze"); } mCallSnoozeonStop = false; final String snooze = PreferenceManager.getDefaultSharedPreferences(this) Loading Loading @@ -249,6 +251,7 @@ public class AlarmAlertFullScreen extends Activity implements GlowPadView.OnTrig if (LOG) { Log.v("AlarmAlertFullScreen - dismiss"); } mCallSnoozeonStop = false; Log.i(killed ? "Alarm killed" : "Alarm dismissed by user"); // The service told us that the alarm has been killed, do not modify Loading Loading @@ -300,6 +303,17 @@ public class AlarmAlertFullScreen extends Activity implements GlowPadView.OnTrig } } @Override protected void onStop() { if (LOG) { Log.v("AlarmAlertFullScreen - onStop snooze=" + mCallSnoozeonStop); } if (mCallSnoozeonStop) { snooze(); } super.onStop(); } @Override public void onDestroy() { super.onDestroy(); Loading Loading @@ -344,16 +358,6 @@ public class AlarmAlertFullScreen extends Activity implements GlowPadView.OnTrig return super.dispatchKeyEvent(event); } @Override public void onBackPressed() { // Don't allow back to dismiss. This method is overriden by AlarmAlert // so that the dialog is dismissed. if (LOG) { Log.v("AlarmAlertFullScreen - onBackPressed"); } return; } @Override public void onGrabbed(View v, int handle) { Loading
src/com/android/deskclock/AlarmKlaxon.java +2 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import android.media.MediaPlayer; import android.media.MediaPlayer.OnErrorListener; import android.media.RingtoneManager; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Message; Loading Loading @@ -56,6 +55,7 @@ public class AlarmKlaxon extends Service { // Internal messages private static final int KILLER = 1000; private Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { switch (msg.what) { case KILLER: Loading Loading @@ -174,6 +174,7 @@ public class AlarmKlaxon extends Service { // RingtoneManager. mMediaPlayer = new MediaPlayer(); mMediaPlayer.setOnErrorListener(new OnErrorListener() { @Override public boolean onError(MediaPlayer mp, int what, int extra) { Log.e("Error occurred while playing audio."); mp.stop(); Loading
src/com/android/deskclock/DeskClock.java +1 −8 Original line number Diff line number Diff line Loading @@ -38,17 +38,12 @@ import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import android.view.animation.AnimationUtils; import android.view.animation.ScaleAnimation; import android.view.animation.Transformation; import android.view.animation.TranslateAnimation; import android.widget.LinearLayout.LayoutParams; import android.widget.PopupMenu; import android.widget.TextView; import android.widget.Toast; import com.android.deskclock.stopwatch.StopwatchFragment; import com.android.deskclock.stopwatch.StopwatchService; Loading Loading @@ -258,9 +253,7 @@ public class DeskClock extends Activity implements LabelDialogFragment.TimerLabe SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(Timers.NOTIF_APP_OPEN, false); editor.apply(); Intent timerIntent = new Intent(); timerIntent.setAction(Timers.NOTIF_IN_USE_SHOW); sendBroadcast(timerIntent); Utils.showInUseNotifications(this); super.onPause(); } Loading
src/com/android/deskclock/TimerRingService.java +1 −2 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.media.MediaPlayer.OnErrorListener; import android.media.RingtoneManager; import android.net.Uri; import android.os.IBinder; import android.os.Vibrator; import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; Loading Loading @@ -105,7 +104,7 @@ public class TimerRingService extends Service { } if (Log.LOGV) { Log.v("TimerRingSErvice.play()"); Log.v("TimerRingService.play()"); } // TODO: Reuse mMediaPlayer instead of creating a new one and/or use Loading