diff options
author | 2017-01-23 09:59:08 -0800 | |
---|---|---|
committer | 2017-01-23 23:26:08 +0000 | |
commit | 05376628da19c7247c909f86cf2324c32f08c25b (patch) | |
tree | cc3ac4f30b072296b0e7b42bbf92e941779300c9 | |
parent | 2a8719c801c36ccda36971b7626fd4ebb9993577 (diff) |
Don't put loading results to system cache if exceptions happened.
Test: Manual smoke tests. Automatic tests pass.
Bug: 34405495
Change-Id: If8ce36ce38eef840655be84438856ca12187c393
(cherry picked from commit 51b8ca37126b63cb5e4c9fe4a8f092c104290486)
-rw-r--r-- | src/com/android/documentsui/roots/RootsCache.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/documentsui/roots/RootsCache.java b/src/com/android/documentsui/roots/RootsCache.java index ad91228c1..3d367a6bf 100644 --- a/src/com/android/documentsui/roots/RootsCache.java +++ b/src/com/android/documentsui/roots/RootsCache.java @@ -260,7 +260,11 @@ public class RootsCache implements RootsAccess { roots.add(root); } } catch (Exception e) { - Log.w(TAG, "Failed to load some roots from " + authority + ": " + e); + Log.w(TAG, "Failed to load some roots from " + authority, e); + // We didn't load every root from the provider. Don't put it to + // system cache so that we'll try loading them again next time even + // if forceRefresh is false. + return roots; } finally { IoUtils.closeQuietly(cursor); ContentProviderClient.releaseQuietly(client); |