summaryrefslogtreecommitdiff
path: root/libs/androidfw/BackupData.cpp
diff options
context:
space:
mode:
author beiyifb <beiyi@meta.com> 2023-05-03 16:25:12 -0700
committer beiyifb <beiyi@meta.com> 2023-05-03 16:47:36 -0700
commit68a22d8d8a024db94bb0d482d7f3e2de879b04ea (patch)
treeb8ad4a0e043cd08e7f786c38731f9fca23307666 /libs/androidfw/BackupData.cpp
parentf6f72da24ff4540fb04bb0ecae0a5555278abf99 (diff)
Fixes a thread safety issue (a time-of-check-time-of-use bug) in BatteryExternalStatsWorker that causes system_server crashes in VROS device.
Synchronize BatteryExternalStatsWorker.shutdown(). Without this, a shutdown can sneak in-between the checks to mExecutor.isShutdown() and other mExecutor calls, causing the later calls to fail with a RejectedExecutionException instead of having the intended behavior for a shutdown mExecutor. Test: There is no known test case for regression testing. This is a race condition, so any test case would inherently be flaky. The correctness of the patch is easily seen by observing the time-of-check-time-of-use issues that arise throughout BatteryExternalStatsWorker.java before the patch is applied. Change-Id: Id690f3451f86ac536b186021ef4fb63827bc863e
Diffstat (limited to 'libs/androidfw/BackupData.cpp')
0 files changed, 0 insertions, 0 deletions