summaryrefslogtreecommitdiff
path: root/core/java/android/util/SparseSetArray.java
diff options
context:
space:
mode:
authorHui Yu <huiyu@google.com>2022-03-17 13:17:08 -0700
committerHui Yu <huiyu@google.com>2022-03-18 15:19:06 -0700
commitbb89d23c33c5595012bdf044855b7baba96e1851 (patch)
tree8951ab99311580fbd3d16c11988f7555668ee7bc /core/java/android/util/SparseSetArray.java
parent40ca086c4003e70760284e5fb3ad6361d8dc3387 (diff)
Increase startForeground() timeout to 30 seconds.
Right now there is 10 seconds grace period from Context.startForegroudService() to Service.startForeground() call, afterwards we crash the app and thow ForegroundServiceDidNotStartInTimeException, at the same time generate ANR report. Make the startForegroundService() to startForeground() grace period configurable, increase the default value from 10 seconds to 30 seconds. This value can be changed by command "adb shell device_config put activity_manager service_start_foreground_timeout_ms 30000" After the 30 seconds service_start_foreground_timeout_ms and ForegroundServiceDidNotStartInTimeException, delay the ANR generation for another 10 seconds configurable by service_start_foreground_anr_delay_ms. This value can be changed by "adb shell device_config put activity_manager service_start_foreground_anr_delay_ms 10000". At the end of service_start_foreground_anr_delay_ms, if the app's process is still alive, the ANR report will be taken. Otherwise, there is no ANR report. Bug: 219514357 Test: adb shell device_config put activity_manager service_start_foreground_timeout_ms, adb shell device_config put activity_manager service_start_foreground_anr_delay_ms, Manual test, in test app, startForegroundService() but not call startForeground(), 30 seconds later, observe the ForegroundServiceDidNotStartInTimeException, 10 seconds later, try to take the ANR report. Change-Id: I5f30d0996bff23f8a302cedef01eaa31e6ff29ce
Diffstat (limited to 'core/java/android/util/SparseSetArray.java')
0 files changed, 0 insertions, 0 deletions