Loading src/com/android/deskclock/DeskClock.java +0 −2 Original line number Diff line number Diff line Loading @@ -222,7 +222,6 @@ public class DeskClock extends BaseActivity SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(Timers.NOTIF_APP_OPEN, true); editor.apply(); Utils.cancelTimesUpNotifications(this); Utils.updateTimesUpNotification(this); sendBroadcast(new Intent(Timers.NOTIF_IN_USE_CANCEL)); mActivityResumed = true; Loading @@ -241,7 +240,6 @@ public class DeskClock extends BaseActivity editor.apply(); Utils.showInUseNotifications(this); Utils.updateTimesUpNotification(this); super.onPause(); } Loading src/com/android/deskclock/Utils.java +0 −18 Original line number Diff line number Diff line Loading @@ -305,24 +305,6 @@ public class Utils { context.sendBroadcast(timerHUNIntent); } /** * Broadcast a message to show the in-use timers in the notifications */ public static void showTimesUpNotifications(Context context) { Intent timerIntent = new Intent(); timerIntent.setAction(Timers.NOTIF_TIMES_UP_SHOW); context.sendBroadcast(timerIntent); } /** * Broadcast a message to cancel the in-use timers in the notifications */ public static void cancelTimesUpNotifications(Context context) { Intent timerIntent = new Intent(); timerIntent.setAction(Timers.NOTIF_TIMES_UP_CANCEL); context.sendBroadcast(timerIntent); } /** Runnable for use with screensaver and dream, to move the clock every minute. * registerViews() must be called prior to posting. */ Loading src/com/android/deskclock/timer/TimerAlertFullScreen.java +0 −5 Original line number Diff line number Diff line Loading @@ -77,16 +77,11 @@ public class TimerAlertFullScreen extends BaseActivity implements OnEmptyListLis protected void onResume() { super.onResume(); // Only show notifications for times-up when this activity closed. Utils.cancelTimesUpNotifications(this); overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out); } @Override public void onPause() { Utils.showTimesUpNotifications(this); super.onPause(); } Loading src/com/android/deskclock/timer/TimerReceiver.java +5 −11 Original line number Diff line number Diff line Loading @@ -74,13 +74,9 @@ public class TimerReceiver extends BroadcastReceiver { case Timers.NOTIF_IN_USE_SHOW: showInUseNotification(context); return; case Timers.NOTIF_TIMES_UP_SHOW: case Timers.NOTIF_UPDATE: updateTimesUpNotification(context); return; case Timers.NOTIF_TIMES_UP_CANCEL: cancelTimesUpNotification(context); return; case Timers.NOTIF_RESET_ALL_TIMERS: resetAllTimers(context, prefs); return; Loading Loading @@ -172,6 +168,9 @@ public class TimerReceiver extends BroadcastReceiver { stopTimer(prefs, t); } stopRingtoneIfNoTimesup(context); // Flag to tell DeskClock to re-sync with the database. Important if the HUN stop is // clicked while TimerFragment is open. prefs.edit().putBoolean(Timers.REFRESH_UI_WITH_LATEST_DATA, true).apply(); } else if (Timers.NOTIF_TIMES_UP_PLUS_ONE.equals(actionType)) { // Find the timer (if it doesn't exists, it was probably deleted). if (t == null) { Loading Loading @@ -606,12 +605,6 @@ public class TimerReceiver extends BroadcastReceiver { private void updateTimesUpNotification(final Context context) { final ArrayList<TimerObj> timesUpTimers = Timers.timersInTimesUp(mTimers); if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean( Timers.NOTIF_APP_OPEN, false)) { cancelTimesUpNotification(context); return; } if (timesUpTimers.isEmpty()) { LogUtils.i("No more timers are firing."); cancelTimesUpNotification(context); Loading @@ -628,7 +621,8 @@ public class TimerReceiver extends BroadcastReceiver { * @param context * @param timesUpTimers list of Timers in TIMES_UP state */ private void updateTimesUpNotification(final Context context, ArrayList<TimerObj> timesUpTimers) { private void updateTimesUpNotification(final Context context, ArrayList<TimerObj> timesUpTimers) { NotificationManagerCompat nm = NotificationManagerCompat.from(context); final TimerObj timerObj = timesUpTimers.get(0); Loading src/com/android/deskclock/timer/Timers.java +0 −2 Original line number Diff line number Diff line Loading @@ -50,8 +50,6 @@ public class Timers { public static final String NOTIF_STOP_ALL_TIMERS = "notif_stop_all_timers"; public static final String NOTIF_TIMES_UP_STOP = "notif_times_up_stop"; public static final String NOTIF_TIMES_UP_PLUS_ONE = "notif_times_up_plus_one"; public static final String NOTIF_TIMES_UP_SHOW = "notif_times_up_show"; public static final String NOTIF_TIMES_UP_CANCEL = "notif_times_up_cancel"; public static final String FIRST_LAUNCH_FROM_API_CALL = "first_launch_from_api_call"; public static final String SCROLL_TO_TIMER_ID = "scroll_to_timer_id"; Loading Loading
src/com/android/deskclock/DeskClock.java +0 −2 Original line number Diff line number Diff line Loading @@ -222,7 +222,6 @@ public class DeskClock extends BaseActivity SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean(Timers.NOTIF_APP_OPEN, true); editor.apply(); Utils.cancelTimesUpNotifications(this); Utils.updateTimesUpNotification(this); sendBroadcast(new Intent(Timers.NOTIF_IN_USE_CANCEL)); mActivityResumed = true; Loading @@ -241,7 +240,6 @@ public class DeskClock extends BaseActivity editor.apply(); Utils.showInUseNotifications(this); Utils.updateTimesUpNotification(this); super.onPause(); } Loading
src/com/android/deskclock/Utils.java +0 −18 Original line number Diff line number Diff line Loading @@ -305,24 +305,6 @@ public class Utils { context.sendBroadcast(timerHUNIntent); } /** * Broadcast a message to show the in-use timers in the notifications */ public static void showTimesUpNotifications(Context context) { Intent timerIntent = new Intent(); timerIntent.setAction(Timers.NOTIF_TIMES_UP_SHOW); context.sendBroadcast(timerIntent); } /** * Broadcast a message to cancel the in-use timers in the notifications */ public static void cancelTimesUpNotifications(Context context) { Intent timerIntent = new Intent(); timerIntent.setAction(Timers.NOTIF_TIMES_UP_CANCEL); context.sendBroadcast(timerIntent); } /** Runnable for use with screensaver and dream, to move the clock every minute. * registerViews() must be called prior to posting. */ Loading
src/com/android/deskclock/timer/TimerAlertFullScreen.java +0 −5 Original line number Diff line number Diff line Loading @@ -77,16 +77,11 @@ public class TimerAlertFullScreen extends BaseActivity implements OnEmptyListLis protected void onResume() { super.onResume(); // Only show notifications for times-up when this activity closed. Utils.cancelTimesUpNotifications(this); overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out); } @Override public void onPause() { Utils.showTimesUpNotifications(this); super.onPause(); } Loading
src/com/android/deskclock/timer/TimerReceiver.java +5 −11 Original line number Diff line number Diff line Loading @@ -74,13 +74,9 @@ public class TimerReceiver extends BroadcastReceiver { case Timers.NOTIF_IN_USE_SHOW: showInUseNotification(context); return; case Timers.NOTIF_TIMES_UP_SHOW: case Timers.NOTIF_UPDATE: updateTimesUpNotification(context); return; case Timers.NOTIF_TIMES_UP_CANCEL: cancelTimesUpNotification(context); return; case Timers.NOTIF_RESET_ALL_TIMERS: resetAllTimers(context, prefs); return; Loading Loading @@ -172,6 +168,9 @@ public class TimerReceiver extends BroadcastReceiver { stopTimer(prefs, t); } stopRingtoneIfNoTimesup(context); // Flag to tell DeskClock to re-sync with the database. Important if the HUN stop is // clicked while TimerFragment is open. prefs.edit().putBoolean(Timers.REFRESH_UI_WITH_LATEST_DATA, true).apply(); } else if (Timers.NOTIF_TIMES_UP_PLUS_ONE.equals(actionType)) { // Find the timer (if it doesn't exists, it was probably deleted). if (t == null) { Loading Loading @@ -606,12 +605,6 @@ public class TimerReceiver extends BroadcastReceiver { private void updateTimesUpNotification(final Context context) { final ArrayList<TimerObj> timesUpTimers = Timers.timersInTimesUp(mTimers); if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean( Timers.NOTIF_APP_OPEN, false)) { cancelTimesUpNotification(context); return; } if (timesUpTimers.isEmpty()) { LogUtils.i("No more timers are firing."); cancelTimesUpNotification(context); Loading @@ -628,7 +621,8 @@ public class TimerReceiver extends BroadcastReceiver { * @param context * @param timesUpTimers list of Timers in TIMES_UP state */ private void updateTimesUpNotification(final Context context, ArrayList<TimerObj> timesUpTimers) { private void updateTimesUpNotification(final Context context, ArrayList<TimerObj> timesUpTimers) { NotificationManagerCompat nm = NotificationManagerCompat.from(context); final TimerObj timerObj = timesUpTimers.get(0); Loading
src/com/android/deskclock/timer/Timers.java +0 −2 Original line number Diff line number Diff line Loading @@ -50,8 +50,6 @@ public class Timers { public static final String NOTIF_STOP_ALL_TIMERS = "notif_stop_all_timers"; public static final String NOTIF_TIMES_UP_STOP = "notif_times_up_stop"; public static final String NOTIF_TIMES_UP_PLUS_ONE = "notif_times_up_plus_one"; public static final String NOTIF_TIMES_UP_SHOW = "notif_times_up_show"; public static final String NOTIF_TIMES_UP_CANCEL = "notif_times_up_cancel"; public static final String FIRST_LAUNCH_FROM_API_CALL = "first_launch_from_api_call"; public static final String SCROLL_TO_TIMER_ID = "scroll_to_timer_id"; Loading