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
6b03ce8f
authored
Nov 18, 2019
by
olly
Committed by
Oliver Woodman
Nov 19, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove SimpleCache hacks that are no longer used
PiperOrigin-RevId: 281049383
parent
09df3a01
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
36 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 @
6b03ce8f
...
@@ -61,9 +61,6 @@ public final class SimpleCache implements Cache {
...
@@ -61,9 +61,6 @@ 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
cacheInitializationExceptionsDisabled
;
private
final
File
cacheDir
;
private
final
File
cacheDir
;
private
final
CacheEvictor
evictor
;
private
final
CacheEvictor
evictor
;
private
final
CachedContentIndex
contentIndex
;
private
final
CachedContentIndex
contentIndex
;
...
@@ -86,33 +83,6 @@ public final class SimpleCache implements Cache {
...
@@ -86,33 +83,6 @@ public final class SimpleCache implements Cache {
}
}
/**
/**
* Disables locking the cache folders which {@link SimpleCache} instances are using and releases
* any previous lock.
*
* <p>The locking prevents multiple {@link SimpleCache} instances from being created for the same
* folder. Disabling it may cause the cache data to be corrupted. Use at your own risk.
*
* @deprecated Don't create multiple {@link SimpleCache} instances for the same cache folder. If
* you need to create another instance, make sure you call {@link #release()} on the previous
* instance.
*/
@Deprecated
public
static
synchronized
void
disableCacheFolderLocking
()
{
cacheFolderLockingDisabled
=
true
;
lockedCacheDirs
.
clear
();
}
/**
* 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.
...
@@ -304,7 +274,7 @@ public final class SimpleCache implements Cache {
...
@@ -304,7 +274,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
(
!
cacheInitializationExceptionsDisabled
&&
initializationException
!=
null
)
{
if
(
initializationException
!=
null
)
{
throw
initializationException
;
throw
initializationException
;
}
}
}
}
...
@@ -828,15 +798,10 @@ public final class SimpleCache implements Cache {
...
@@ -828,15 +798,10 @@ public final class SimpleCache implements Cache {
}
}
private
static
synchronized
boolean
lockFolder
(
File
cacheDir
)
{
private
static
synchronized
boolean
lockFolder
(
File
cacheDir
)
{
if
(
cacheFolderLockingDisabled
)
{
return
true
;
}
return
lockedCacheDirs
.
add
(
cacheDir
.
getAbsoluteFile
());
return
lockedCacheDirs
.
add
(
cacheDir
.
getAbsoluteFile
());
}
}
private
static
synchronized
void
unlockFolder
(
File
cacheDir
)
{
private
static
synchronized
void
unlockFolder
(
File
cacheDir
)
{
if
(!
cacheFolderLockingDisabled
)
{
lockedCacheDirs
.
remove
(
cacheDir
.
getAbsoluteFile
());
lockedCacheDirs
.
remove
(
cacheDir
.
getAbsoluteFile
());
}
}
}
}
}
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