summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index b4f409d1902b..e83bb127c141 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -20703,8 +20703,10 @@ public final class ActivityManagerService extends ActivityManagerNative
isInteraction = nowElapsed > app.fgInteractionTime + SERVICE_USAGE_INTERACTION_TIME;
}
} else {
- isInteraction = app.curProcState
- <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND;
+ // If the app was being forced to the foreground, by say a Toast, then
+ // no need to treat it as an interaction
+ isInteraction = app.forcingToForeground == null
+ && app.curProcState <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND;
app.fgInteractionTime = 0;
}
if (isInteraction && (!app.reportedInteraction