Commit 0813385e authored by Yohann Roussel's avatar Yohann Roussel
Browse files

Reinstall on IOException when patching the CL

When an IOException occurs during installSecondaryDexes of
MultiDex.install, clear the extraction dir and make one supplementary
attempt to extract and install.
The obective is to recover from some cases of corrupted extractions or
corrupted odex files whitout requiring manual clearing of application
data.

The extraction, patching of the classloader, and recover is now done under
file lock protection to avoid clearing the cache directory while another
process would be using it. This should not cause more ANRs because
extraction was already done under file lock and dexopt which is the main
part of classloader patching is running under its own lock protection.

MultiDex.installInstrumentation isn't attempting this recover to keep
test failing in case of corruption and keep corrupted files and
hopefully allow more precise investigations. Note that adding recovering
capability to MultiDex.installInstrumentation would require changing
locking strategy.

Bug: 28832787
Test: MultiDexLegacyTestServicesTests2
Change-Id: I247918c1fbec8686ade12b37b8680539688a61a9
parent 6f110bb9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment