diff options
-rw-r--r-- | services/core/java/com/android/server/am/ActivityStack.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index cefa3c0..f676db9 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -4230,7 +4230,8 @@ final class ActivityStack { if (focusedStack && topTask) { // Give the latest time to ensure foreground task can be sorted // at the first, because lastActiveTime of creating task is 0. - ci.lastActiveTime = System.currentTimeMillis(); + // Only do this if the clock didn't run backwards, though. + ci.lastActiveTime = Math.max(ci.lastActiveTime, System.currentTimeMillis()); topTask = false; } |