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

Commit 779f6a10 authored by Hui Yu's avatar Hui Yu
Browse files

Need to call resetFgsRestrictionLocked() before calling

setFgsRestrictionLocked() again.

Bug: 191159915
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testStartForegroundTimeout
Change-Id: Iedd6f4507fc3ac136a0f62385c0f8b49d43ff778
parent bea81527
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1790,6 +1790,7 @@ public final class ActiveServices {
                        if (!r.fgRequired) {
                            final long delayMs = SystemClock.elapsedRealtime() - r.createRealTime;
                            if (delayMs > mAm.mConstants.mFgsStartForegroundTimeoutMs) {
                                resetFgsRestrictionLocked(r);
                                setFgsRestrictionLocked(r.serviceInfo.packageName, r.app.getPid(),
                                        r.appInfo.uid, r.intent.getIntent(), r, r.userId,false);
                                final String temp = "startForegroundDelayMs:" + delayMs;