From e586c58c6b55aa053de696b68aeb0fbf9d7dfec7 Mon Sep 17 00:00:00 2001 From: Phillip Hsu Date: Fri, 16 Sep 2016 17:55:16 -0700 Subject: [PATCH] Tried stuff that didn't work --- .../ChronometerNotificationService.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/philliphsu/clock2/ChronometerNotificationService.java b/app/src/main/java/com/philliphsu/clock2/ChronometerNotificationService.java index 42364c7..d7c36dd 100644 --- a/app/src/main/java/com/philliphsu/clock2/ChronometerNotificationService.java +++ b/app/src/main/java/com/philliphsu/clock2/ChronometerNotificationService.java @@ -98,11 +98,26 @@ public abstract class ChronometerNotificationService extends Service { mDelegate.setCountDown(isCountDown()); } + // Didn't work! +// @Override +// public void onTrimMemory(int level) { +// if (level >= TRIM_MEMORY_BACKGROUND) { +// Log.d("ChronomNotifService", "Stopping foreground"); +// // The penultimate trim level, indicates the process is around the +// // middle of the background LRU list. +// // If we didn't call this, we would continue to run in the foreground +// // until we get killed, and the notification would be removed with it. +// // We want to keep the notification alive even if the process is killed, +// // so the user can still be aware of the stopwatch. +// stopForeground(true); +// // Post it again, but outside of the foreground state. +// updateNotification(true); +// } +// } + @Override public void onDestroy() { - super.onDestroy(); - quitThread(); - // TODO: Cancel all notifications pushed by this notification manager. + quitThread(); // TOneverDO: quitCurrentThread() because that posts the notification again } @CallSuper