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

Commit 1f97cf3f authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/27164179']...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/27164179'] into sparse-11781665-L76000030003479651.
SPARSE_CHANGE: Idf303b7acfd73f46481309029816686a5161ada7

Change-Id: I5fafee2c8b8fab8eebed4f7366dec0658bbbd954
parents 0c944be1 d92165c0
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);