From 372a4b3b26b9b4e6444ac423fef237d497b6dd5b Mon Sep 17 00:00:00 2001 From: Bernardo Rufino Date: Wed, 29 Apr 2020 11:40:07 +0100 Subject: [PATCH] Call proc.setLastActivityLaunchTime() in realStartActivityLocked() ..after we set the time. This is because BAL's grace period stopped working after that call was removed in ag/9536366 (since without the method call ActivityRecord.lastLaunchTime would be 0). I'm not familiar with this area, other than to say this fixes the bug linked. I'm putting this up given we're blocking some legitimate activity starts such as starts from the launcher. Please let me know if this should be a different fix! Bug: 152621860 Test: atest BackgroundActivityLaunchTest#testBackgroundActivityNotBlockedWithinGracePeriod Change-Id: I1a329f6a044f5aa491474f5be538991ede0f8f53 --- .../core/java/com/android/server/wm/ActivityStackSupervisor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/core/java/com/android/server/wm/ActivityStackSupervisor.java b/services/core/java/com/android/server/wm/ActivityStackSupervisor.java index fe9e5f3ca09e4..4e7d4eeaac36e 100644 --- a/services/core/java/com/android/server/wm/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/wm/ActivityStackSupervisor.java @@ -784,6 +784,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { r.launchCount++; r.lastLaunchTime = SystemClock.uptimeMillis(); + proc.setLastActivityLaunchTime(r.lastLaunchTime); if (DEBUG_ALL) Slog.v(TAG, "Launching: " + r);