Fix data dir lock handling on old OS versions.
Older versions of Android implement file locking incorrectly in the Java standard library: they throw IOException instead of returning null when the lock is already held by another process. This causes us to crash when the lock is already held, without attempting to retry or considering whether we're intending to crash vs warn. Catch and ignore the exception when it comes from the tryLock call, and only consider IOException fatal when it's thrown by the RandomAccessFile constructor. Bug: 558377 Fixed: 1048982 Change-Id: I66c5665a8e94e2713233b9799db6694ce5bfa077 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2050366 Commit-Queue: Richard Coles <torne@chromium.org> Commit-Queue: Tobias Sargeant <tobiasjs@chromium.org> Auto-Submit: Richard Coles <torne@chromium.org> Reviewed-by:Tobias Sargeant <tobiasjs@chromium.org> Cr-Commit-Position: refs/heads/master@{#740287}
Showing
Please register or sign in to comment