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

Commit 21492dcd authored by Varun Shah's avatar Varun Shah
Browse files

Don't throw ANR if onTimeout flag is disabled.

Bug: 327566365
Test: atest CtsFgsTimeoutTestCases
Change-Id: I6601fd1af8cd617bae5e3c3deb1019d65c5e3908
parent 0fa3534c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -3867,10 +3867,12 @@ public final class ActiveServices {
                Slog.w(TAG_SERVICE, "Exception from scheduleTimeoutServiceForType: " + e);
            }

            if (android.app.Flags.introduceNewServiceOntimeoutCallback()) {
                // ANR the service after giving the service some time to clean up.
                mFGSAnrTimer.start(sr, mAm.mConstants.mFgsAnrExtraWaitDuration);
            }
        }
    }

    void onFgsAnrTimeout(ServiceRecord sr) {
        final int fgsType = getTimeLimitedFgsType(sr.foregroundServiceType);