Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
42b64122
authored
Apr 02, 2019
by
olly
Committed by
Oliver Woodman
Apr 05, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Provide flag to disable throwing of cache initialization exceptions
PiperOrigin-RevId: 241497141
parent
9dc22c30
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java
library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java
View file @
42b64122
...
@@ -62,6 +62,7 @@ public final class SimpleCache implements Cache {
...
@@ -62,6 +62,7 @@ public final class SimpleCache implements Cache {
private
static
final
HashSet
<
File
>
lockedCacheDirs
=
new
HashSet
<>();
private
static
final
HashSet
<
File
>
lockedCacheDirs
=
new
HashSet
<>();
private
static
boolean
cacheFolderLockingDisabled
;
private
static
boolean
cacheFolderLockingDisabled
;
private
static
boolean
cacheInitializationExceptionsDisabled
;
private
final
File
cacheDir
;
private
final
File
cacheDir
;
private
final
CacheEvictor
evictor
;
private
final
CacheEvictor
evictor
;
...
@@ -101,6 +102,16 @@ public final class SimpleCache implements Cache {
...
@@ -101,6 +102,16 @@ public final class SimpleCache implements Cache {
}
}
/**
/**
* Disables throwing of cache initialization exceptions.
*
* @deprecated Don't use this. Provided for problematic upgrade cases only.
*/
@Deprecated
public
static
void
disableCacheInitializationExceptions
()
{
cacheInitializationExceptionsDisabled
=
true
;
}
/**
* Deletes all content belonging to a cache instance.
* Deletes all content belonging to a cache instance.
*
*
* @param cacheDir The cache directory.
* @param cacheDir The cache directory.
...
@@ -272,7 +283,7 @@ public final class SimpleCache implements Cache {
...
@@ -272,7 +283,7 @@ public final class SimpleCache implements Cache {
* @throws CacheException If an error occurred during initialization.
* @throws CacheException If an error occurred during initialization.
*/
*/
public
synchronized
void
checkInitialization
()
throws
CacheException
{
public
synchronized
void
checkInitialization
()
throws
CacheException
{
if
(
initializationException
!=
null
)
{
if
(
!
cacheInitializationExceptionsDisabled
&&
initializationException
!=
null
)
{
throw
initializationException
;
throw
initializationException
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment