Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c82b33df authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't call FGS onTimeout if app is currently in TOP state." into main

parents d7ba7e3c 0397e74f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -3892,9 +3892,10 @@ public final class ActiveServices {
                return;
            }

            final long lastTopTime = sr.app.mState.getLastTopTime();
            final long constantTimeLimit = getTimeLimitForFgsType(fgsType);
            final boolean currentlyTop = sr.app.mState.getCurProcState() <= PROCESS_STATE_TOP;
            final long nowUptime = SystemClock.uptimeMillis();
            final long lastTopTime = currentlyTop ? nowUptime : sr.app.mState.getLastTopTime();
            final long constantTimeLimit = getTimeLimitForFgsType(fgsType);
            if (lastTopTime != Long.MIN_VALUE && constantTimeLimit > (nowUptime - lastTopTime)) {
                // Discard any other messages for this service
                mAm.mHandler.removeMessages(ActivityManagerService.SERVICE_FGS_TIMEOUT_MSG, sr);