commit | ba82ea3c5d628f5039fa615de42cb92b3752400b | [log] [tgz] |
---|---|---|
author | Varun Shah <varunshah@google.com> | Fri Apr 19 17:33:24 2024 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Mon Apr 22 17:08:04 2024 +0000 |
tree | 2cbbc2ce7aedaa56e3f74737849f20995918ee5a | |
parent | 8e20321648f378481cfae5b7221ce37b110860a5 [diff] |
Don't throw ANR if onTimeout flag is disabled. Bug: 327566365 Test: atest CtsFgsTimeoutTestCases (cherry picked from commit 21492dcd91c86fa06c423fbe60876a219421892f) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:78f268a3bbbba1233aba5ba675563b2b62d90f76) Merged-In: I6601fd1af8cd617bae5e3c3deb1019d65c5e3908 Change-Id: I6601fd1af8cd617bae5e3c3deb1019d65c5e3908
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index b8e09cc..24eba4a 100644 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -3696,7 +3696,9 @@ // is not "now". Compute the time from "now" when starting the anr timer. final long anrTime = sr.getEarliestStopTypeAndTime().second + mAm.mConstants.mFgsAnrExtraWaitDuration - SystemClock.uptimeMillis(); - mFGSAnrTimer.start(sr, anrTime); + if (android.app.Flags.introduceNewServiceOntimeoutCallback()) { + mFGSAnrTimer.start(sr, anrTime); + } } }