Merge "Frameworks: Silently ignore InterruptedException" am: 7e717e09cd

am: a6c6c4f5d3

Change-Id: I737474738fa688d5bc651390409cbd792ffa7282
This commit is contained in:
Andreas Gampe
2017-12-05 02:43:53 +00:00
committed by android-build-merger

View File

@@ -217,10 +217,15 @@ final class SharedPreferencesImpl implements SharedPreferences {
}
private @GuardedBy("mLock") Map<String, Object> getLoaded() {
try {
return mMap.get();
} catch (InterruptedException | ExecutionException e) {
throw new IllegalStateException(e);
// For backwards compatibility, we need to ignore any interrupts. b/70122540.
for (;;) {
try {
return mMap.get();
} catch (ExecutionException e) {
throw new IllegalStateException(e);
} catch (InterruptedException e) {
// Ignore and try again.
}
}
}
private @GuardedBy("mLock") Map<String, Object> getLoadedWithBlockGuard() {