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

Commit 738ad402 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/27164179'] into 24Q3-release.

Change-Id: Ie08715da421d3a42e70350cf1bb43cac07ca3a7f
parents bd69b27b 528d0277
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -3864,10 +3864,12 @@ public final class ActiveServices {
            final long lastTopTime = sr.app.mState.getLastTopTime();
            final long constantTimeLimit = getTimeLimitForFgsType(fgsType);
            final long nowUptime = SystemClock.uptimeMillis();
            if (constantTimeLimit > (nowUptime - lastTopTime)) {
            if (lastTopTime != Long.MIN_VALUE && constantTimeLimit > (nowUptime - lastTopTime)) {
                // Discard any other messages for this service
                mFGSAnrTimer.discard(sr);
                mAm.mHandler.removeMessages(ActivityManagerService.SERVICE_FGS_TIMEOUT_MSG, sr);
                // The app was in the TOP state after the FGS was started so its time allowance
                // should be counted from that time since this is considered a user interaction
                mFGSAnrTimer.discard(sr);
                final Message msg = mAm.mHandler.obtainMessage(
                                        ActivityManagerService.SERVICE_FGS_TIMEOUT_MSG, sr);
                mAm.mHandler.sendMessageAtTime(msg, lastTopTime + constantTimeLimit);