From ebc1b2d2cc61aa6f8b6e8efa4af894e0d6cdbcc7 Mon Sep 17 00:00:00 2001 From: vyao Date: Fri, 13 Apr 2018 10:38:09 -0700 Subject: [PATCH] Automated g4 rollback of changelist 191834511. *** Reason for rollback *** Rolling back to re-disable the exception as the crash is still appearing on latest version *** Original change description *** Automated g4 rollback of changelist 191128111. *** Reason for rollback *** This was a temp fix to be cherrypicked into YouTube Andorid Main App 13.12 to resolve P0 b/77315136. *** Original change description *** Temp fix for b/77315136: Don't lock or check cache directories in SimpleCache To be immediately rolled back after submission Submitting on behalf of cblay. *** *** ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=192789263 --- .../upstream/cache/SimpleCache.java | 4 ---- .../upstream/cache/SimpleCacheTest.java | 22 +++++++++---------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java index a5869122fe..ca0063bf86 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java @@ -93,10 +93,6 @@ public final class SimpleCache implements Cache { * @param index The CachedContentIndex to be used. */ /*package*/ SimpleCache(File cacheDir, CacheEvictor evictor, CachedContentIndex index) { - if (!lockFolder(cacheDir)) { - throw new IllegalStateException("Another SimpleCache instance uses the folder: " + cacheDir); - } - this.cacheDir = cacheDir; this.evictor = evictor; this.index = index; diff --git a/library/core/src/test/java/com/google/android/exoplayer2/upstream/cache/SimpleCacheTest.java b/library/core/src/test/java/com/google/android/exoplayer2/upstream/cache/SimpleCacheTest.java index 15e2b80f59..a35a86f933 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/upstream/cache/SimpleCacheTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/upstream/cache/SimpleCacheTest.java @@ -296,17 +296,17 @@ public class SimpleCacheTest { } } - @Test - public void testMultipleSimpleCacheWithSameCacheDirThrowsException() throws Exception { - new SimpleCache(cacheDir, new NoOpCacheEvictor()); - - try { - new SimpleCache(cacheDir, new NoOpCacheEvictor()); - assertWithMessage("Exception was expected").fail(); - } catch (IllegalStateException e) { - // Expected. Do nothing. - } - } + // @Test + // public void testMultipleSimpleCacheWithSameCacheDirThrowsException() throws Exception { + // new SimpleCache(cacheDir, new NoOpCacheEvictor()); + // + // try { + // new SimpleCache(cacheDir, new NoOpCacheEvictor()); + // assertWithMessage("Exception was expected").fail(); + // } catch (IllegalStateException e) { + // // Expected. Do nothing. + // } + // } @Test public void testMultipleSimpleCacheWithSameCacheDirDoesNotThrowsExceptionAfterRelease()