Temporarily disable cache UID creation.
PiperOrigin-RevId: 239476751
This commit is contained in:
parent
3abf5ed143
commit
68ef1d3e97
@ -77,6 +77,9 @@ public interface Cache {
|
|||||||
super(cause);
|
super(cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CacheException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -557,16 +557,18 @@ public final class SimpleCache implements Cache {
|
|||||||
private void initialize() {
|
private void initialize() {
|
||||||
if (!cacheDir.exists()) {
|
if (!cacheDir.exists()) {
|
||||||
if (!cacheDir.mkdirs()) {
|
if (!cacheDir.mkdirs()) {
|
||||||
initializationException =
|
String message = "Failed to create cache directory: " + cacheDir;
|
||||||
new CacheException("Failed to create cache directory: " + cacheDir);
|
Log.e(TAG, message);
|
||||||
|
initializationException = new CacheException(message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
File[] files = cacheDir.listFiles();
|
File[] files = cacheDir.listFiles();
|
||||||
if (files == null) {
|
if (files == null) {
|
||||||
initializationException =
|
String message = "Failed to list cache directory files: " + cacheDir;
|
||||||
new CacheException("Failed to list cache directory files: " + cacheDir);
|
Log.e(TAG, message);
|
||||||
|
initializationException = new CacheException(message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -575,8 +577,11 @@ public final class SimpleCache implements Cache {
|
|||||||
try {
|
try {
|
||||||
uid = createUid(cacheDir);
|
uid = createUid(cacheDir);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
initializationException = new CacheException("Failed to create cache UID: " + cacheDir);
|
String message = "Failed to create cache UID: " + cacheDir;
|
||||||
return;
|
Log.e(TAG, message, e);
|
||||||
|
// TODO: Reinstate this only when a database index is used [Internal ref: b/128933265].
|
||||||
|
// initializationException = new CacheException(message, e);
|
||||||
|
// return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -591,7 +596,9 @@ public final class SimpleCache implements Cache {
|
|||||||
loadDirectory(cacheDir, /* isRoot= */ true, files, /* fileMetadata= */ null);
|
loadDirectory(cacheDir, /* isRoot= */ true, files, /* fileMetadata= */ null);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
initializationException = new CacheException(e);
|
String message = "Failed to initialize cache indices: " + cacheDir;
|
||||||
|
Log.e(TAG, message, e);
|
||||||
|
initializationException = new CacheException(message, e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user